From 68e2e2f3a9285c94ccc82726e7d05eb8b76977e3 Mon Sep 17 00:00:00 2001 From: Teodor Dermendjiev Date: Fri, 3 Mar 2023 11:44:56 +0200 Subject: [PATCH] Check remote package hash and compare current --- src/app-sync.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/app-sync.ts b/src/app-sync.ts index c914ac8..5b8d6e1 100644 --- a/src/app-sync.ts +++ b/src/app-sync.ts @@ -136,6 +136,14 @@ export class AppSync { AppSync.syncInProgress = false; return; } + + const versionIsCurrent = remotePackage.packageHash === ApplicationSettings.getString(AppSync.CURRENT_HASH_KEY); + if (versionIsCurrent) { + console.log("Update already installed."); + syncCallback && syncCallback(SyncStatus.UP_TO_DATE); + AppSync.syncInProgress = false; + return; + } const onError = (error: Error) => { console.log("Download error: " + error);