mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 11:13:46 +00:00
Merge branch 'master' into verify-email-for-send
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
<app-callout type="warning" icon="fa fa-external-link fa-rotate-270 fa-fw" [clickable]="true"
|
||||
title="{{'sendFileCalloutHeader' | i18n}}"
|
||||
*ngIf="showFilePopoutMessage && send.type === sendType.File && !disableSend" (click)="popOutWindow()">
|
||||
<div *ngIf="showLinuxChromiumFileWarning">{{'sendLinuxChromiumFileWarning' | i18n}}</div>
|
||||
<div *ngIf="showChromiumFileWarning">{{'sendLinuxChromiumFileWarning' | i18n}}</div>
|
||||
<div *ngIf="showFirefoxFileWarning">{{'sendFirefoxFileWarning' | i18n}}</div>
|
||||
<div *ngIf="showSafariFileWarning">{{'sendSafariFileWarning' | i18n}}</div>
|
||||
</app-callout>
|
||||
|
||||
@@ -35,6 +35,7 @@ export class SendAddEditComponent extends BaseAddEditComponent {
|
||||
inPopout = false;
|
||||
inSidebar = false;
|
||||
isLinux = false;
|
||||
isUnsupportedMac = false;
|
||||
|
||||
constructor(i18nService: I18nService, platformUtilsService: PlatformUtilsService,
|
||||
userService: UserService, messagingService: MessagingService, policyService: PolicyService,
|
||||
@@ -46,14 +47,14 @@ export class SendAddEditComponent extends BaseAddEditComponent {
|
||||
}
|
||||
|
||||
get showFileSelector(): boolean {
|
||||
return !this.editMode && (!this.isFirefox && !this.isSafari && !this.isLinux) ||
|
||||
return !this.editMode && (!this.isFirefox && !this.isSafari && !this.isLinux && !this.isUnsupportedMac) ||
|
||||
(this.isFirefox && (this.inSidebar || this.inPopout)) ||
|
||||
(this.isSafari && this.inPopout) ||
|
||||
(this.isLinux && !this.isFirefox && (this.inSidebar || this.inPopout));
|
||||
((this.isLinux || this.isUnsupportedMac) && !this.isFirefox && (this.inSidebar || this.inPopout));
|
||||
}
|
||||
|
||||
get showFilePopoutMessage(): boolean {
|
||||
return !this.editMode && (this.showFirefoxFileWarning || this.showSafariFileWarning || this.showLinuxChromiumFileWarning);
|
||||
return !this.editMode && (this.showFirefoxFileWarning || this.showSafariFileWarning || this.showChromiumFileWarning);
|
||||
}
|
||||
|
||||
get showFirefoxFileWarning(): boolean {
|
||||
@@ -64,9 +65,9 @@ export class SendAddEditComponent extends BaseAddEditComponent {
|
||||
return this.isSafari && !this.inPopout;
|
||||
}
|
||||
|
||||
// Only show this for Chromium based browsers in Linux
|
||||
get showLinuxChromiumFileWarning(): boolean {
|
||||
return this.isLinux && !this.isFirefox && !(this.inSidebar || this.inPopout);
|
||||
// Only show this for Chromium based browsers in Linux and Mac > Big Sur
|
||||
get showChromiumFileWarning(): boolean {
|
||||
return (this.isLinux || this.isUnsupportedMac) && !this.isFirefox && !(this.inSidebar || this.inPopout);
|
||||
}
|
||||
|
||||
popOutWindow() {
|
||||
@@ -79,6 +80,7 @@ export class SendAddEditComponent extends BaseAddEditComponent {
|
||||
this.inPopout = this.popupUtilsService.inPopout(window);
|
||||
this.inSidebar = this.popupUtilsService.inSidebar(window);
|
||||
this.isLinux = window?.navigator?.userAgent.indexOf('Linux') !== -1;
|
||||
this.isUnsupportedMac = this.platformUtilsService.isChrome() && window?.navigator?.appVersion.includes('Mac OS X 11');
|
||||
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async params => {
|
||||
if (params.sendId) {
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { CipherService } from 'jslib/abstractions/cipher.service';
|
||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||
|
||||
import { ConsoleLogService } from 'jslib/services/consoleLog.service';
|
||||
import { SearchService } from 'jslib/services/search.service';
|
||||
|
||||
export class PopupSearchService extends SearchService {
|
||||
constructor(private mainSearchService: SearchService, cipherService: CipherService,
|
||||
consoleLogService: ConsoleLogService) {
|
||||
super(cipherService, consoleLogService);
|
||||
consoleLogService: ConsoleLogService, i18nService: I18nService) {
|
||||
super(cipherService, consoleLogService, i18nService);
|
||||
}
|
||||
|
||||
clearIndex() {
|
||||
|
||||
@@ -68,7 +68,8 @@ function getBgService<T>(service: string) {
|
||||
export const stateService = new StateService();
|
||||
export const messagingService = new BrowserMessagingService();
|
||||
export const searchService = new PopupSearchService(getBgService<SearchService>('searchService')(),
|
||||
getBgService<CipherService>('cipherService')(), getBgService<ConsoleLogService>('consoleLogService')());
|
||||
getBgService<CipherService>('cipherService')(), getBgService<ConsoleLogService>('consoleLogService')(),
|
||||
getBgService<I18nService>('i18nService')());
|
||||
|
||||
export function initFactory(platformUtilsService: PlatformUtilsService, i18nService: I18nService, storageService: StorageService,
|
||||
popupUtilsService: PopupUtilsService): Function {
|
||||
@@ -90,7 +91,7 @@ export function initFactory(platformUtilsService: PlatformUtilsService, i18nServ
|
||||
|
||||
let theme = await storageService.get<string>(ConstantsService.themeKey);
|
||||
if (theme == null) {
|
||||
theme = platformUtilsService.getDefaultSystemTheme();
|
||||
theme = await platformUtilsService.getDefaultSystemTheme();
|
||||
|
||||
platformUtilsService.onDefaultSystemThemeChange(sysTheme => {
|
||||
window.document.documentElement.classList.remove('theme_light', 'theme_dark');
|
||||
|
||||
Reference in New Issue
Block a user