commit c2905dccab779c0bb37957234b5291107b3c04cf
parent 657706db6552e3e28a6732be00bc161af083d353
Author: Harsheet <hsohaney@mozilla.com>
Date: Tue, 28 Oct 2025 17:03:06 +0000
Bug 1993254 - Refetch backupFileInfo if the file to restore state is updated. r=fchasen,cdupuis
Differential Revision: https://phabricator.services.mozilla.com/D269878
Diffstat:
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/browser/components/backup/content/restore-from-backup.mjs b/browser/components/backup/content/restore-from-backup.mjs
@@ -77,12 +77,7 @@ export default class RestoreFromBackup extends MozLitElement {
);
// If we have a backup file, but not the associated info, fetch the info
- if (
- this.backupServiceState?.backupFileToRestore &&
- !this.backupServiceState?.backupFileInfo
- ) {
- this.getBackupFileInfo();
- }
+ this.maybeGetBackupFileInfo();
this.addEventListener("BackupUI:SelectNewFilepickerPath", this);
@@ -93,6 +88,15 @@ export default class RestoreFromBackup extends MozLitElement {
}
}
+ maybeGetBackupFileInfo() {
+ if (
+ this.backupServiceState?.backupFileToRestore &&
+ !this.backupServiceState?.backupFileInfo
+ ) {
+ this.getBackupFileInfo();
+ }
+ }
+
disconnectedCallback() {
super.disconnectedCallback();
if (this._handleWindowResize) {
@@ -123,6 +127,10 @@ export default class RestoreFromBackup extends MozLitElement {
detail: { recoveryInProgress: inProgress },
})
);
+
+ // It's possible that backupFileToRestore got updated and we need to
+ // refetch the fileInfo
+ this.maybeGetBackupFileInfo();
}
}