Skip to content

Commit

Permalink
feat: references modal: auto select first favorite resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Sep 3, 2024
1 parent 2852b19 commit 0eb4dcd
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ const countPerType = computed(() => {
// Current type
const selectedType = ref(fieldResourceType.value?.implementations?.[0])
const { isFavorite } = await useFavoriteResources()
const implementations = fieldResourceType.value?.implementations ?? []
const initialSelectedType = implementations.find(impl => isFavorite(impl)) ?? implementations[0]
const selectedType = ref(initialSelectedType)
const currentResourceName = computed(() => selectedType.value ?? props.field.resourceName)
Expand Down

0 comments on commit 0eb4dcd

Please sign in to comment.