diff --git a/AnkiConnect.py b/AnkiConnect.py index 4606611..5336c96 100644 --- a/AnkiConnect.py +++ b/AnkiConnect.py @@ -1044,14 +1044,14 @@ class AnkiConnect: self.collection().models.update(model) - addAndClose = False + closeAfterAdding = False if note is not None and 'options' in note: - if 'addAndClose' in note['options']: - addAndClose = note['options']['addAndClose'] - if type(addAndClose) is not bool: - raise Exception('option parameter \'addAndClose\' must be boolean') + if 'closeAfterAdding' in note['options']: + closeAfterAdding = note['options']['closeAfterAdding'] + if type(closeAfterAdding) is not bool: + raise Exception('option parameter \'closeAfterAdding\' must be boolean') - if addAndClose: + if closeAfterAdding: # an "AddCards" dialogue, that closes when you add a note class AddCardsAndClose(aqt.addcards.AddCards): diff --git a/README.md b/README.md index 927796b..d1c962a 100644 --- a/README.md +++ b/README.md @@ -1345,7 +1345,7 @@ guarantee that your application continues to function properly in the future. Invokes the *Add Cards* dialog and presets the note using the given deck and model, with the provided field values and tags. Invoking it multiple times will open multiple windows. - The `addAndClose` member inside `options` group can be set to true to create a dialog that closes upon adding the first note. + The `closeAfterAdding` member inside `options` group can be set to true to create a dialog that closes upon adding the note. *Sample request*: ```json @@ -1361,7 +1361,7 @@ guarantee that your application continues to function properly in the future. "Extra": "Romania is a country in Europe" }, "options": { - "addAndClose": true + "closeAfterAdding": true }, "tags": [ "yomichan"