Skip to content

Commit

Permalink
feat(dashboard): use new user selector for greetings
Browse files Browse the repository at this point in the history
  • Loading branch information
Satont committed May 10, 2024
1 parent 6733a4e commit 6aa70c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,18 @@ const options = computed(() => {
const searchUsers = twitchSearch.data.value?.channels ?? []
const initialUsers = getUsers.data.value?.users ?? []
return [
const allOptions = [
...mapOptions(searchUsers),
...mapOptions(initialUsers),
]
const uniqueOptions = allOptions.filter((option, index, self) =>
index === self.findIndex((t) => (
t.value === option.value
)),
)
return uniqueOptions
})
const open = ref(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { GreetingsCreateInput } from '@/gql/graphql'
import { type Greetings, useGreetingsApi } from '@/api/greetings'
import DialogOrSheet from '@/components/dialog-or-sheet.vue'
import TwitchUserSearch from '@/components/twitchUsers/single.vue'
import TwitchUsersSelect from '@/components/twitchUsers/twitch-users-select.vue'
import { Button } from '@/components/ui/button'
import {
Dialog,
Expand Down Expand Up @@ -129,7 +129,7 @@ const rules: FormRules = {
<div class="grid gap-4 py-4">
<NSpace vertical class="w-full">
<NFormItem :label="t('sharedTexts.userName')" path="userId" show-require-mark>
<TwitchUserSearch v-model="formValue.userId" :initial-user-id="props.greeting?.userId" />
<TwitchUsersSelect v-model="formValue.userId" :initial="formValue.userId" twir-only />
</NFormItem>
<NFormItem :label="t('sharedTexts.response')" path="text" show-require-mark>
<VariableInput v-model="formValue.text" input-type="textarea" />
Expand Down

0 comments on commit 6aa70c7

Please sign in to comment.