From 2c4742a91dad3bfa8a1a7799991fd6da7bd6d0e1 Mon Sep 17 00:00:00 2001 From: Baptiste Grob <60621355+baptiste-grob@users.noreply.github.com> Date: Thu, 21 Jan 2021 11:56:20 +0100 Subject: [PATCH] feat: make SNWebCrypto a constant --- app/assets/javascripts/crypto.ts | 3 +++ app/assets/javascripts/ui_models/application.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 app/assets/javascripts/crypto.ts diff --git a/app/assets/javascripts/crypto.ts b/app/assets/javascripts/crypto.ts new file mode 100644 index 000000000..28c1edb8d --- /dev/null +++ b/app/assets/javascripts/crypto.ts @@ -0,0 +1,3 @@ +import { SNWebCrypto } from "@standardnotes/sncrypto-web"; + +export const Crypto = new SNWebCrypto(); diff --git a/app/assets/javascripts/ui_models/application.ts b/app/assets/javascripts/ui_models/application.ts index aa8315fc6..7684cd9e6 100644 --- a/app/assets/javascripts/ui_models/application.ts +++ b/app/assets/javascripts/ui_models/application.ts @@ -25,8 +25,8 @@ import { KeyboardManager } from '@/services'; import { AppState } from '@/ui_models/app_state'; -import { SNWebCrypto } from '@standardnotes/sncrypto-web'; import { Bridge } from '@/services/bridge'; +import { Crypto } from '@/crypto'; type WebServices = { appState: AppState; @@ -60,7 +60,7 @@ export class WebApplication extends SNApplication { bridge.environment, platformFromString(getPlatformString()), deviceInterface, - new SNWebCrypto(), + Crypto, new AlertService(), identifier, undefined,