mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 05:13:29 +00:00
[PM-18287] Bugfix - Vault autofill suggestions view hangs on load when the current tab is on the blocked domains list (#13496)
* Fix vault autofill suggestions view hanging on load when the current tab is on the blocked domains list Co-authored-by: Justin Baur <justindbaur@users.noreply.github.com> * fix broken tests * use blockedInteractionsUris$ observable instead of currentTabIsOnBlocklist$ in _currentPageDetails$ --------- Co-authored-by: Justin Baur <justindbaur@users.noreply.github.com>
This commit is contained in:
@@ -67,6 +67,7 @@ describe("VaultPopupAutofillService", () => {
|
||||
.mockReturnValue(true);
|
||||
|
||||
mockAutofillService.collectPageDetailsFromTab$.mockReturnValue(new BehaviorSubject([]));
|
||||
mockDomainSettingsService.blockedInteractionsUris$ = new BehaviorSubject({});
|
||||
|
||||
testBed = TestBed.configureTestingModule({
|
||||
providers: [
|
||||
|
||||
@@ -145,7 +145,22 @@ export class VaultPopupAutofillService {
|
||||
if (!tab) {
|
||||
return of([]);
|
||||
}
|
||||
return this.autofillService.collectPageDetailsFromTab$(tab);
|
||||
|
||||
return this.domainSettingsService.blockedInteractionsUris$.pipe(
|
||||
switchMap((blockedURIs) => {
|
||||
// This blocked URI logic will be updated to use the common util in PM-18219
|
||||
if (blockedURIs && tab?.url?.length) {
|
||||
const tabURL = new URL(tab.url);
|
||||
const tabIsBlocked = Object.keys(blockedURIs).includes(tabURL.hostname);
|
||||
|
||||
if (tabIsBlocked) {
|
||||
return of([]);
|
||||
}
|
||||
}
|
||||
|
||||
return this.autofillService.collectPageDetailsFromTab$(tab);
|
||||
}),
|
||||
);
|
||||
}),
|
||||
shareReplay({ refCount: false, bufferSize: 1 }),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user