add yandex disk pro

This commit is contained in:
fyears
2024-06-11 00:01:36 +08:00
parent 5186dcb967
commit 2e09686675
25 changed files with 1638 additions and 44 deletions
+22 -1
View File
@@ -253,7 +253,9 @@ export const generateProSettingsPart = (
boxAllowedToUsedDiv: HTMLDivElement,
boxNotShowUpHintSetting: Setting,
pCloudAllowedToUsedDiv: HTMLDivElement,
pCloudNotShowUpHintSetting: Setting
pCloudNotShowUpHintSetting: Setting,
yandexDiskAllowedToUsedDiv: HTMLDivElement,
yandexDiskNotShowUpHintSetting: Setting
) => {
proDiv
.createEl("h2", { text: t("settings_pro") })
@@ -351,6 +353,25 @@ export const generateProSettingsPart = (
);
}
const allowYandexDisk =
plugin.settings.pro?.enabledProFeatures.filter(
(x) => x.featureName === "feature-yandex_disk"
).length === 1;
console.debug(
`allow to show up Yandex Disk settings? ${allowYandexDisk}`
);
if (allowYandexDisk) {
yandexDiskAllowedToUsedDiv.removeClass("yandexdisk-allow-to-use-hide");
yandexDiskNotShowUpHintSetting.settingEl.addClass(
"yandexdisk-allow-to-use-hide"
);
} else {
yandexDiskAllowedToUsedDiv.addClass("yandexdisk-allow-to-use-hide");
yandexDiskNotShowUpHintSetting.settingEl.removeClass(
"yandexdisk-allow-to-use-hide"
);
}
new Notice(t("settings_pro_features_refresh_succ"));
});
});