From f9cdf323b894a280f574951c63c050d06f566644 Mon Sep 17 00:00:00 2001 From: fyears <1142836+fyears@users.noreply.github.com> Date: Wed, 13 Apr 2022 22:24:58 +0800 Subject: [PATCH] fix cors --- src/baseTypes.ts | 7 +++++-- src/langs | 2 +- src/settings.ts | 18 ++++-------------- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/baseTypes.ts b/src/baseTypes.ts index 8a74480..e59262b 100644 --- a/src/baseTypes.ts +++ b/src/baseTypes.ts @@ -154,9 +154,12 @@ export interface FileOrFolderMixedState { } export const API_VER_STAT_FOLDER = "0.13.27"; -export const API_VER_REQURL = "0.13.26"; +export const API_VER_REQURL = "0.13.26"; // desktop ver 0.13.26, iOS ver 1.1.1 +export const API_VER_REQURL_ANDROID = "0.14.6"; // Android ver 1.2.1 + export const VALID_REQURL = - requireApiVersion(API_VER_REQURL) && !Platform.isAndroidApp; + (!Platform.isAndroidApp && requireApiVersion(API_VER_REQURL)) || + (Platform.isAndroidApp && requireApiVersion(API_VER_REQURL_ANDROID)); export const DEFAULT_DEBUG_FOLDER = "_debug_remotely_save/"; export const DEFAULT_SYNC_PLANS_HISTORY_FILE_PREFIX = diff --git a/src/langs b/src/langs index 470fe14..9fdb379 160000 --- a/src/langs +++ b/src/langs @@ -1 +1 @@ -Subproject commit 470fe141ef48237e81eb84cb466f9bc7f374274c +Subproject commit 9fdb3792511f5982cfd5b906063ff9daa3593b60 diff --git a/src/settings.ts b/src/settings.ts index 8a5819d..2f7f7ce 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -877,11 +877,7 @@ export class RemotelySaveSettingTab extends PluginSettingTab { if (VALID_REQURL) { new Setting(s3Div) .setName(t("settings_s3_bypasscorslocally")) - .setDesc( - t("settings_s3_bypasscorslocally_desc", { - ver: API_VER_REQURL, - }) - ) + .setDesc(t("settings_s3_bypasscorslocally_desc")) .addDropdown((dropdown) => { dropdown .addOption("disable", t("disable")) @@ -1297,15 +1293,9 @@ export class RemotelySaveSettingTab extends PluginSettingTab { }); if (!VALID_REQURL) { - if (Platform.isAndroidApp) { - webdavDiv.createEl("p", { - text: t("settings_webdav_cors_android"), - }); - } else { - webdavDiv.createEl("p", { - text: t("settings_webdav_cors_otheros"), - }); - } + webdavDiv.createEl("p", { + text: t("settings_webdav_cors_os"), + }); webdavDiv.createEl("p", { text: t("settings_webdav_cors"),