From cfd4b3157b6163bb3acd7b2b7eab007dd2600740 Mon Sep 17 00:00:00 2001 From: Philipp Walter Date: Wed, 19 Mar 2025 14:36:29 +0100 Subject: [PATCH] fix(backup): skip restore for backups containing slashfeed widgets --- src/store/utils/backup.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/store/utils/backup.ts b/src/store/utils/backup.ts index 6f065f0ab..1413e6c01 100644 --- a/src/store/utils/backup.ts +++ b/src/store/utils/backup.ts @@ -358,6 +358,17 @@ const performWidgetsRestore = async (): Promise< const backup = backupRes.value.data; const expectedBackupShape = initialWidgetsState; + + // NOTE: can be removed after all users have updated from 1.0.9 + const hasSlashfeedWidgets = Object.keys(backup.widgets).some((key) => { + return key.includes('slashfeed'); + }); + + // If the backup has slashfeed widgets, skip the restore. + if (hasSlashfeedWidgets) { + return ok({ backupExists: false }); + } + //If the keys in the backup object are not found in the reference object assume the backup does not exist. if (!isObjPartialMatch(backup, expectedBackupShape, ['widgets'])) { return ok({ backupExists: false });