commit 7b2ae9ebd5a9a60e001b0db1616aa190bde4a39a parent 4fd0fa7e5814c0b51f1dd075821988377bc56cc1 Author: Micah Killoran <mtigley@mozilla.com> Date: Wed, 12 Nov 2025 03:27:51 +0000 Bug 1995350 -[contextual-password-manager] Remove #enabled member on LoginDataSource. r=dimi Differential Revision: https://phabricator.services.mozilla.com/D271219 Diffstat:
2 files changed, 5 insertions(+), 21 deletions(-)
diff --git a/toolkit/components/satchel/megalist/aggregator/datasources/LoginDataSource.sys.mjs b/toolkit/components/satchel/megalist/aggregator/datasources/LoginDataSource.sys.mjs @@ -81,8 +81,8 @@ export class LoginDataSource extends DataSourceBase { #originPrototype; #usernamePrototype; #passwordPrototype; - #enabled; #header; + #initialized; #exportPasswordsStrings; #displayMode; @@ -364,6 +364,7 @@ export class LoginDataSource extends DataSourceBase { this.#displayMode = DISPLAY_MODES.ALL; this.#addObservers(); this.#reloadDataSource(); + this.#initialized = true; }); } @@ -790,16 +791,13 @@ export class LoginDataSource extends DataSourceBase { * @param {string} searchText used to filter data */ *enumerateLines(searchText) { - if (this.#enabled === undefined) { + if (!this.#initialized) { // Async Fluent API makes it possible to have data source waiting // for the localized strings, which can be detected by undefined in #enabled. return; } yield this.#header; - if (this.#header.collapsed || !this.#enabled) { - return; - } const stats = { count: 0, total: 0 }; searchText = searchText.toUpperCase(); @@ -822,12 +820,6 @@ export class LoginDataSource extends DataSourceBase { */ async #reloadDataSource() { this.doneReloadDataSource = false; - this.#enabled = Services.prefs.getBoolPref("signon.rememberSignons"); - if (!this.#enabled) { - this.#reloadEmptyDataSource(); - this.doneReloadDataSource = true; - return; - } const logins = await LoginHelper.getAllUserFacingLogins(); const breachesMap = lazy.BREACH_ALERTS_ENABLED @@ -909,14 +901,6 @@ export class LoginDataSource extends DataSourceBase { this.afterReloadingDataSource(); } - #reloadEmptyDataSource() { - this.lines.length = 0; - //todo: user can enable passwords by activating Passwords header line - this.#header.value.total = 0; - this.#header.value.alerts = 0; - this.refreshAllLinesOnScreen(); - } - getAuthTimeoutMs() { return AUTH_TIMEOUT_MS; } diff --git a/toolkit/components/satchel/megalist/aggregator/tests/unit/test_loginDataSourceReloadDataSource.js b/toolkit/components/satchel/megalist/aggregator/tests/unit/test_loginDataSourceReloadDataSource.js @@ -72,8 +72,8 @@ add_task( ); Assert.ok( - !loginDataSource.lines.length, - "if rememberSignons pref is off, no logins should be loaded" + loginDataSource.lines.length, + "if rememberSignons pref is off, logins should still be loaded" ); } );