mirror of
https://github.com/bitwarden/browser
synced 2026-02-14 23:45:37 +00:00
added methods to EnvService that were originally not migrated
• PlatformUtilsService.copyToClipboard() • PlatformUtilsService.readFromClipboard() • DEPRECATED PlatformUtilsService.showToast() these methods weren't being used, but in order to avoid breaking anything, I've added them
This commit is contained in:
@@ -53,6 +53,17 @@ export abstract class EnvService {
|
||||
abstract supportsFileDownloads(): boolean;
|
||||
abstract isDev(): boolean;
|
||||
abstract isSelfHost(): boolean;
|
||||
abstract copyToClipboard(text: string, options?: any): void | boolean;
|
||||
abstract readFromClipboard(): Promise<string>;
|
||||
abstract supportsSecureStorage(): boolean;
|
||||
abstract getAutofillKeyboardShortcut(): Promise<string>;
|
||||
/**
|
||||
* @deprecated use `@bitwarden/components/ToastService.showToast` instead
|
||||
*/
|
||||
abstract showToast(
|
||||
type: "error" | "success" | "warning" | "info",
|
||||
title: string,
|
||||
text: string | string[],
|
||||
options?: any,
|
||||
): void;
|
||||
}
|
||||
|
||||
@@ -210,6 +210,14 @@ export class DefaultEnvService extends EnvService {
|
||||
return this.platformUtilsService.isSelfHost();
|
||||
}
|
||||
|
||||
copyToClipboard(text: string, options?: any) {
|
||||
return this.platformUtilsService.copyToClipboard(text, options);
|
||||
}
|
||||
|
||||
readFromClipboard() {
|
||||
return this.platformUtilsService.readFromClipboard();
|
||||
}
|
||||
|
||||
supportsSecureStorage() {
|
||||
return this.platformUtilsService.supportsSecureStorage();
|
||||
}
|
||||
@@ -217,4 +225,16 @@ export class DefaultEnvService extends EnvService {
|
||||
getAutofillKeyboardShortcut() {
|
||||
return this.platformUtilsService.getAutofillKeyboardShortcut();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use `@bitwarden/components/ToastService.showToast` instead
|
||||
*/
|
||||
showToast(
|
||||
type: "error" | "success" | "warning" | "info",
|
||||
title: string,
|
||||
text: string | string[],
|
||||
options?: any,
|
||||
) {
|
||||
return this.platformUtilsService.showToast(type, title, text, options);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user