mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Update reviewer.py to prevent custom scheduler js from commenting out py code (#3795)
* Update reviewer.py to prevent custom scheduler js from commenting out py code * Do not use custom code, but move {js} instead
This commit is contained in:
parent
01c4b48c7d
commit
44e01ea063
1 changed files with 6 additions and 2 deletions
|
@ -1215,7 +1215,11 @@ timerStopped = false;
|
|||
setFlag = set_flag_on_current_card
|
||||
|
||||
|
||||
# if the last element is a comment, then the RUN_STATE_MUTATION code
|
||||
# breaks due to the comment wrongly commenting out python code.
|
||||
# To prevent this we put the js code on a separate line
|
||||
RUN_STATE_MUTATION = """
|
||||
anki.mutateNextCardStates('{key}', async (states, customData, ctx) => {{ {js} }})
|
||||
.finally(() => bridgeCommand('statesMutated'));
|
||||
anki.mutateNextCardStates('{key}', async (states, customData, ctx) => {{
|
||||
{js}
|
||||
}}).finally(() => bridgeCommand('statesMutated'));
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue