mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 10:13:31 +00:00
Merge branch 'master' of github.com:bitwarden/browser into feature/safari-webext
# Conflicts: # src/browser/safariApp.ts # src/safari/safari/SafariExtensionViewController.swift # src/services/browserPlatformUtils.service.ts
This commit is contained in:
@@ -254,7 +254,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
||||
}
|
||||
}
|
||||
|
||||
const autoFillResponse = await this.doAutoFill({
|
||||
const totpCode = await this.doAutoFill({
|
||||
cipher: cipher,
|
||||
pageDetails: pageDetails,
|
||||
skipTotp: !fromCommand,
|
||||
@@ -265,12 +265,12 @@ export default class AutofillService implements AutofillServiceInterface {
|
||||
fillNewPassword: fromCommand,
|
||||
});
|
||||
|
||||
// Only update last used index if doAutoFill didn't throw an exception
|
||||
// Update last used index as autofill has succeed
|
||||
if (fromCommand) {
|
||||
this.cipherService.updateLastUsedIndexForUrl(tab.url);
|
||||
}
|
||||
|
||||
return autoFillResponse;
|
||||
return totpCode;
|
||||
}
|
||||
|
||||
// Helpers
|
||||
|
||||
@@ -16,6 +16,7 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
|
||||
private showDialogResolves = new Map<number, { resolve: (value: boolean) => void, date: Date }>();
|
||||
private deviceCache: DeviceType = null;
|
||||
private analyticsIdCache: string = null;
|
||||
private prefersColorSchemeDark = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
|
||||
constructor(private messagingService: MessagingService,
|
||||
private clipboardWriteCallback: (clipboardValue: string, clearMs: number) => void,
|
||||
@@ -303,4 +304,14 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
|
||||
supportsSecureStorage(): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
getDefaultSystemTheme() {
|
||||
return this.prefersColorSchemeDark.matches ? 'dark' : 'light';
|
||||
}
|
||||
|
||||
onDefaultSystemThemeChange(callback: ((theme: 'light' | 'dark') => unknown)) {
|
||||
this.prefersColorSchemeDark.addListener(({ matches }) => {
|
||||
callback(matches ? 'dark' : 'light');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user