From 77525814703ddc24d8b4a8afc88ebda5448f7b30 Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Mon, 30 Oct 2023 22:58:09 +0800 Subject: [PATCH] chore: throttle switchversion --- lib/main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/main.ts b/lib/main.ts index 553ab23..b7fa3b7 100644 --- a/lib/main.ts +++ b/lib/main.ts @@ -322,10 +322,12 @@ function assertHash(hash: string) { return true; } +let applyingUpdate = false; export function switchVersion(hash: string) { assertRelease(); - if (assertHash(hash)) { + if (assertHash(hash) && !applyingUpdate) { logger('switchVersion: ' + hash); + applyingUpdate = true; PushyModule.reloadUpdate({ hash }); } }