add support for ios 5-times click

This commit is contained in:
fyears 2021-11-27 00:49:21 +08:00
parent b581ef3f31
commit 9128f9ed5b

View File

@ -296,8 +296,18 @@ class RemotelySaveSettingTab extends PluginSettingTab {
// we need to create the div in advance of s3Div and webdavDiv // we need to create the div in advance of s3Div and webdavDiv
const serviceChooserDiv = generalDiv.createEl("div"); const serviceChooserDiv = generalDiv.createEl("div");
let clickChooserTimes = 0;
serviceChooserDiv.onClickEvent((x) => { serviceChooserDiv.onClickEvent((x) => {
if (x.detail === 5) { if (Platform.isIosApp) {
// downgrade the experiment
// because iOS doesn't support x.detail
clickChooserTimes += 1;
setTimeout(function () {
clickChooserTimes = 0;
}, 2000);
}
if ((Platform.isIosApp && clickChooserTimes === 5) || x.detail === 5) {
if (this.plugin.settings.serviceType === "webdav") { if (this.plugin.settings.serviceType === "webdav") {
new Notice( new Notice(
"You've enabled hidden unstable experimental webdav support before. Nothing changes." "You've enabled hidden unstable experimental webdav support before. Nothing changes."
@ -316,6 +326,7 @@ class RemotelySaveSettingTab extends PluginSettingTab {
); );
} }
} }
x.preventDefault();
}); });
const s3Div = containerEl.createEl("div", { cls: "s3-hide" }); const s3Div = containerEl.createEl("div", { cls: "s3-hide" });