From 59dbbcf6fd179c6d4555b52ea04eb68350819ac8 Mon Sep 17 00:00:00 2001 From: Baptiste Grob <60621355+baptiste-grob@users.noreply.github.com> Date: Thu, 11 Mar 2021 15:41:29 +0100 Subject: [PATCH] feat: authorize CloudLink access --- app/assets/javascripts/ui_models/application.ts | 15 +++++++++++---- package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/ui_models/application.ts b/app/assets/javascripts/ui_models/application.ts index 38cc85274..d47790a9f 100644 --- a/app/assets/javascripts/ui_models/application.ts +++ b/app/assets/javascripts/ui_models/application.ts @@ -204,10 +204,17 @@ export class WebApplication extends SNApplication { } async openModalComponent(component: SNComponent): Promise { - if (component.package_info?.identifier === "org.standardnotes.batch-manager") { - if (!await this.authorizeBatchManagerAccess()) { - return; - } + switch (component.package_info?.identifier) { + case 'org.standardnotes.batch-manager': + if (!await this.authorizeBatchManagerAccess()) { + return; + } + break; + case 'org.standardnotes.cloudlink': + if (!await this.authorizeCloudLinkAccess()) { + return; + } + break; } const scope = this.scope!.$new(true) as Partial; scope.componentUuid = component.uuid; diff --git a/package.json b/package.json index 6a94b0981..e453f4715 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "@reach/alert-dialog": "^0.13.0", "@reach/dialog": "^0.13.0", "@standardnotes/sncrypto-web": "^1.2.10", - "@standardnotes/snjs": "^2.0.67", + "@standardnotes/snjs": "^2.0.69", "mobx": "^6.1.6", "preact": "^10.5.12" } diff --git a/yarn.lock b/yarn.lock index e12a45984..415e03bb0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1850,10 +1850,10 @@ "@standardnotes/sncrypto-common" "^1.2.7" libsodium-wrappers "^0.7.8" -"@standardnotes/snjs@^2.0.67": - version "2.0.67" - resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.0.67.tgz#87e29f40bb5efaa36f30ddc5905164f7dce194d9" - integrity sha512-XCDxlFQCh0zmV3Hc9mjU7ritZ/2Ma5JPoCbDy4CIAlkKdmVL4tu/4jCfRFILM0zpKF/kLsCTbLGdG7TgU/ReKg== +"@standardnotes/snjs@^2.0.69": + version "2.0.69" + resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.0.69.tgz#8bb5184547673442555bd07a33b998b85117885c" + integrity sha512-S+7ozn+Xi2BAKZE1yM0wWHPLXOR4wAqUomZRU0jP1SK8XJwb2XMUKhM84wSK2AOfFDTvONzeqC5/lAK9ZXT+Sw== dependencies: "@standardnotes/auth" "^2.0.0" "@standardnotes/sncrypto-common" "^1.2.9"