Bug 1890427 - Part 8: Use an observer to regenerate backups on permission removal. r=backup-reviewers,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D218878
This commit is contained in:
@@ -3167,6 +3167,7 @@ export class BackupService extends EventTarget {
|
||||
Services.obs.addObserver(this.#observer, "passwordmgr-storage-changed");
|
||||
Services.obs.addObserver(this.#observer, "formautofill-storage-changed");
|
||||
Services.obs.addObserver(this.#observer, "sanitizer-sanitization-complete");
|
||||
Services.obs.addObserver(this.#observer, "perm-changed");
|
||||
Services.obs.addObserver(this.#observer, "quit-application-granted");
|
||||
}
|
||||
|
||||
@@ -3197,7 +3198,11 @@ export class BackupService extends EventTarget {
|
||||
|
||||
Services.obs.removeObserver(this.#observer, "passwordmgr-storage-changed");
|
||||
Services.obs.removeObserver(this.#observer, "formautofill-storage-changed");
|
||||
Services.obs.removeObserver(this.#observer, "sanitizer-sanitization-complete");
|
||||
Services.obs.removeObserver(
|
||||
this.#observer,
|
||||
"sanitizer-sanitization-complete"
|
||||
);
|
||||
Services.obs.removeObserver(this.#observer, "perm-changed");
|
||||
Services.obs.removeObserver(this.#observer, "quit-application-granted");
|
||||
this.#observer = null;
|
||||
|
||||
@@ -3248,6 +3253,12 @@ export class BackupService extends EventTarget {
|
||||
this.#debounceRegeneration();
|
||||
break;
|
||||
}
|
||||
case "perm-changed": {
|
||||
if (data == "deleted") {
|
||||
this.#debounceRegeneration();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user