fix callback for dropbox

This commit is contained in:
fyears 2024-01-13 16:47:55 +08:00
parent 87d6e1f75f
commit a6b73bde6a
3 changed files with 12 additions and 9 deletions

View File

@ -68,9 +68,7 @@ import { applyPresetRulesInplace } from "./presetRules";
import { applyLogWriterInplace, log } from "./moreOnLog";
import AggregateError from "aggregate-error";
import {
exportVaultSyncPlansToFiles,
} from "./debugMode";
import { exportVaultSyncPlansToFiles } from "./debugMode";
import { SizesConflictModal } from "./syncSizesConflictNotice";
import { compareVersion } from "./misc";
@ -589,7 +587,7 @@ export default class RemotelySavePlugin extends Plugin {
async (e: any) => {
new Notice(t("protocol_dropbox_connect_fail"));
new Notice(`${e}`);
return;
throw e;
}
);

View File

@ -231,7 +231,9 @@ export const sendAuthReq = async (
return resp2;
} catch (e) {
log.error(e);
await errorCallBack(e);
if (errorCallBack !== undefined) {
await errorCallBack(e);
}
}
};

View File

@ -19,9 +19,7 @@ import {
WebdavAuthType,
WebdavDepthType,
} from "./baseTypes";
import {
exportVaultSyncPlansToFiles,
} from "./debugMode";
import { exportVaultSyncPlansToFiles } from "./debugMode";
import { exportQrCodeUri } from "./importExport";
import {
clearAllSyncMetaMapping,
@ -407,7 +405,12 @@ class DropboxAuthModal extends Modal {
const authRes = await sendAuthReqDropbox(
this.plugin.settings.dropbox.clientID,
verifier,
authCode
authCode,
async (e: any) => {
new Notice(t("protocol_dropbox_connect_fail"));
new Notice(`${e}`);
throw e;
}
);
const self = this;
setConfigBySuccessfullAuthInplace(