Skip to content

Commit cfd4b31

Browse files
committed
fix(backup): skip restore for backups containing slashfeed widgets
1 parent ea17893 commit cfd4b31

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/store/utils/backup.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,17 @@ const performWidgetsRestore = async (): Promise<
358358

359359
const backup = backupRes.value.data;
360360
const expectedBackupShape = initialWidgetsState;
361+
362+
// NOTE: can be removed after all users have updated from 1.0.9
363+
const hasSlashfeedWidgets = Object.keys(backup.widgets).some((key) => {
364+
return key.includes('slashfeed');
365+
});
366+
367+
// If the backup has slashfeed widgets, skip the restore.
368+
if (hasSlashfeedWidgets) {
369+
return ok({ backupExists: false });
370+
}
371+
361372
//If the keys in the backup object are not found in the reference object assume the backup does not exist.
362373
if (!isObjPartialMatch(backup, expectedBackupShape, ['widgets'])) {
363374
return ok({ backupExists: false });

0 commit comments

Comments
 (0)