Skip to content
Snippets Groups Projects
Commit ffec764b authored by Philipp Stadler's avatar Philipp Stadler
Browse files

fix: Zeichenanimation-Probleme in Anki Desktop und Anki Web behoben

In der letzten Version hat sich ein Bug eingeschlichen der nur Anki Desktop und Anki Web betroffen hat. Die animierten Zeichen wurden auf der ersten Karte die gezeigt wurde, normal dargestellt, aber auf allen weiteren fehlten sie dann. Dieses Problem ist jetzt behoben und man kann auch in diesen Versionen von Anki wieder normal üben.

Closes #298
parent 78341d70
Branches
Tags
1 merge request!116fix: Name für 亅 (Radikal 6) hinzugefügt
......@@ -81,19 +81,17 @@ async function fetchNonBrowser (char: string): Promise<HanziData> {
}
/**
* Called from the JSONP script with the data.
* Callback for the JSONP scripts with the data.
*
* Raw JSON would not work with AnkiDroid, which does not support XHR/fetch,
* but allows scripts.
*
* In AnkiDroid, every card gets a fresh window, but desktop and Anki Web
* preserved the callback from the last call. If window already contains a
* callback, it works to just overwrite the old callback here that is no longer
* needed. See #298 for details.
*/
if (!canAccessFilesystem) {
if (typeof window[jsonpCallbackFnName] !== 'undefined') {
throw new Error(
`Cannot register jsonp callback because window.${
jsonpCallbackFnName
} is used`
)
}
window[jsonpCallbackFnName] = (char: string, data: HanziData) => {
(jsonpWaiters.get(char) ?? []).forEach(w => {
// careful: every consumer gets an identical object, don't modify
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment