mirror of
https://github.com/manibatra/obsidian-text2anki-openai.git
synced 2026-07-22 07:40:28 +00:00
Handle checking for deck correctly
This commit is contained in:
parent
f3f8d546ff
commit
b3560b6ab8
1 changed files with 2 additions and 4 deletions
6
main.ts
6
main.ts
|
|
@ -159,10 +159,8 @@ export default class FlashcardGeneratorPlugin extends Plugin {
|
|||
async getDeckId(name: string) {
|
||||
try {
|
||||
const decks = await this.invokeAnkiConnect("deckNamesAndIds");
|
||||
for (const deck of decks) {
|
||||
if (deck.name === name) {
|
||||
return deck.id;
|
||||
}
|
||||
if (decks[name]) {
|
||||
return decks[name];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
|
|
|||
Loading…
Reference in a new issue