Fix sync problems

This commit is contained in:
2023-10-26 02:09:33 +03:00
parent c03315c1d0
commit 4fd9f01a28
5 changed files with 29 additions and 18 deletions

View File

@ -683,6 +683,10 @@ export class UserAPI {
return args.map((arg) => JSON.stringify(arg)).join(",");
};
public resetAllFromCache = (): void => {
this.patternCache.forEach((player) => (player as Player).reset());
}
public z = (
input: string,
options: InputOptions = {},
@ -701,7 +705,7 @@ export class UserAPI {
}
if (!player) {
player = new Player(input, options, this.app);
player = new Player(input, options, this.app, zid);
this.app.api.patternCache.set(key, player);
}
@ -709,7 +713,7 @@ export class UserAPI {
player.updateLastCallTime();
if (id !== "") {
if (id !== "" && zid !== "z0") {
// Sync named patterns to z0 by default
player.sync("z0");
}