mirror of
https://github.com/bitwarden/browser
synced 2026-03-02 19:41:26 +00:00
@@ -65,7 +65,7 @@ export class BrowserApi {
|
||||
return;
|
||||
}
|
||||
|
||||
return new Promise(resolve => {
|
||||
return new Promise<void>(resolve => {
|
||||
chrome.tabs.sendMessage(tab.id, obj, options, () => {
|
||||
if (chrome.runtime.lastError) {
|
||||
// Some error happened
|
||||
@@ -181,7 +181,7 @@ export class BrowserApi {
|
||||
if (BrowserApi.isWebExtensionsApi) {
|
||||
return browser.runtime.getPlatformInfo();
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
return new Promise(resolve => {
|
||||
chrome.runtime.getPlatformInfo(resolve);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -118,6 +118,6 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
|
||||
}
|
||||
|
||||
async isLinux() {
|
||||
return (await BrowserApi.getPlatformInfo()).os === "linux";
|
||||
return (await BrowserApi.getPlatformInfo()).os === 'linux';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
import 'core-js';
|
||||
import 'zone.js/dist/zone';
|
||||
|
||||
import { DragDropModule } from '@angular/cdk/drag-drop';
|
||||
import { ToasterModule } from 'angular2-toaster';
|
||||
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import 'core-js/es7/reflect';
|
||||
|
||||
import { enableProdMode } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
import 'web-animations-js';
|
||||
|
||||
// tslint:disable-next-line
|
||||
require('./scss/popup.scss');
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* tslint:disable */
|
||||
require('date-input-polyfill');
|
||||
import 'core-js/stable';
|
||||
import 'date-input-polyfill';
|
||||
import 'web-animations-js';
|
||||
import 'zone.js/dist/zone';
|
||||
/* tslint:enable */
|
||||
|
||||
@@ -353,6 +353,6 @@ input[type="password"]::-ms-reveal {
|
||||
// option elements will not render background-color correctly if identical to parent background-color
|
||||
select option {
|
||||
@include themify($themes) {
|
||||
background-color: adjust-color(themed('inputBackgroundColor'), +1);
|
||||
background-color: darken(themed('inputBackgroundColor'), +1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ $fa-font-path: "~font-awesome/fonts";
|
||||
@extend .btn;
|
||||
|
||||
&.swal2-confirm {
|
||||
@extend .btn.primary;
|
||||
@extend .btn, .primary;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,6 +171,13 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
|
||||
}, 200);
|
||||
}
|
||||
|
||||
closeOnEsc(e: KeyboardEvent) {
|
||||
// If input not empty, use browser default behavior of clearing input instead
|
||||
if (e.key === 'Escape' && (this.searchText == null || this.searchText === '')) {
|
||||
BrowserApi.closePopup(window);
|
||||
}
|
||||
}
|
||||
|
||||
private async load() {
|
||||
const tab = await BrowserApi.getTabFromCurrentWindow();
|
||||
if (tab != null) {
|
||||
@@ -226,11 +233,4 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
|
||||
this.loginCiphers = this.loginCiphers.sort((a, b) => this.cipherService.sortCiphersByLastUsedThenName(a, b));
|
||||
this.loaded = true;
|
||||
}
|
||||
|
||||
closeOnEsc(e: KeyboardEvent) {
|
||||
// If input not empty, use browser default behavior of clearing input instead
|
||||
if (e.key === 'Escape' && (this.searchText == null || this.searchText === '')) {
|
||||
BrowserApi.closePopup(window);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,15 @@ const ScopeStateId = ComponentId + 'Scope';
|
||||
templateUrl: 'groupings.component.html',
|
||||
})
|
||||
export class GroupingsComponent extends BaseGroupingsComponent implements OnInit, OnDestroy {
|
||||
|
||||
get showNoFolderCiphers(): boolean {
|
||||
return this.noFolderCiphers != null && this.noFolderCiphers.length < this.noFolderListSize &&
|
||||
this.collections.length === 0;
|
||||
}
|
||||
|
||||
get folderCount(): number {
|
||||
return this.nestedFolders.length - (this.showNoFolderCiphers ? 0 : 1);
|
||||
}
|
||||
ciphers: CipherView[];
|
||||
favoriteCiphers: CipherView[];
|
||||
noFolderCiphers: CipherView[];
|
||||
@@ -78,15 +87,6 @@ export class GroupingsComponent extends BaseGroupingsComponent implements OnInit
|
||||
this.noFolderListSize = 100;
|
||||
}
|
||||
|
||||
get showNoFolderCiphers(): boolean {
|
||||
return this.noFolderCiphers != null && this.noFolderCiphers.length < this.noFolderListSize &&
|
||||
this.collections.length === 0;
|
||||
}
|
||||
|
||||
get folderCount(): number {
|
||||
return this.nestedFolders.length - (this.showNoFolderCiphers ? 0 : 1);
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
this.searchTypeSearch = !this.platformUtilsService.isSafari();
|
||||
this.showLeftHeader = !(this.popupUtils.inSidebar(window) && this.platformUtilsService.isFirefox());
|
||||
@@ -296,6 +296,13 @@ export class GroupingsComponent extends BaseGroupingsComponent implements OnInit
|
||||
return this.hasSearched || (!this.searchPending && this.searchService.isSearchable(this.searchText));
|
||||
}
|
||||
|
||||
closeOnEsc(e: KeyboardEvent) {
|
||||
// If input not empty, use browser default behavior of clearing input instead
|
||||
if (e.key === 'Escape' && (this.searchText == null || this.searchText === '')) {
|
||||
BrowserApi.closePopup(window);
|
||||
}
|
||||
}
|
||||
|
||||
private async saveState() {
|
||||
this.state = {
|
||||
scrollY: this.popupUtils.getContentScrollY(window),
|
||||
@@ -353,11 +360,4 @@ export class GroupingsComponent extends BaseGroupingsComponent implements OnInit
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
closeOnEsc(e: KeyboardEvent) {
|
||||
// If input not empty, use browser default behavior of clearing input instead
|
||||
if (e.key === 'Escape' && (this.searchText == null || this.searchText === '')) {
|
||||
BrowserApi.closePopup(window);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export default class BrowserStorageService implements StorageService {
|
||||
async save(key: string, obj: any): Promise<any> {
|
||||
if (obj == null) {
|
||||
// Fix safari not liking null in set
|
||||
return new Promise(resolve => {
|
||||
return new Promise<void>(resolve => {
|
||||
this.chromeStorageApi.remove(key, () => {
|
||||
resolve();
|
||||
});
|
||||
@@ -30,7 +30,7 @@ export default class BrowserStorageService implements StorageService {
|
||||
}
|
||||
|
||||
const keyedObj = { [key]: obj };
|
||||
return new Promise(resolve => {
|
||||
return new Promise<void>(resolve => {
|
||||
this.chromeStorageApi.set(keyedObj, () => {
|
||||
resolve();
|
||||
});
|
||||
@@ -38,7 +38,7 @@ export default class BrowserStorageService implements StorageService {
|
||||
}
|
||||
|
||||
async remove(key: string): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
return new Promise<void>(resolve => {
|
||||
this.chromeStorageApi.remove(key, () => {
|
||||
resolve();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user