Skip to content

Commit

Permalink
fix: showing word knowledge refresh buttons when they wouldn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
BrewingWeasel committed Aug 25, 2024
1 parent 32c26a3 commit 0da9136
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pages/GettingStarted.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ async function finishWizard() {
<template v-if="stepIndex === 3">
<h1 class="text-xl font-semibold">Customize Word Knowledge</h1>
<template v-if="models && deckNames">
<WordKnowledge :models :deckNames :decks />
<WordKnowledge :models :deckNames :decks :refreshButtons="false" />
</template>
<div v-else class="flex items-center flex-col mt-3">
<h2>Anki is not available</h2>
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ async function newLanguage(language: string) {
<WordKnowledge
:decks="settings.languages[selectedLang].anki_parser"
:models
:refreshButtons="true"
:deckNames
/>
</Suspense>
Expand Down
3 changes: 2 additions & 1 deletion src/pages/settings/components/WordKnowledge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const props = defineProps<{
decks: Deck[];
models: string[];
deckNames: string[];
refreshButtons: boolean;
}>();
const notesOpen = ref<boolean[][]>([]);
Expand Down Expand Up @@ -86,7 +87,7 @@ async function refreshAnki(forceAll: boolean) {
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
<div class="py-2">
<div class="py-2" v-if="props.refreshButtons">
<Button variant="outline" class="mr-2" @click="refreshAnki(false)"
>Refresh Anki knowledge</Button
>
Expand Down

0 comments on commit 0da9136

Please sign in to comment.