mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
This commit is contained in:
parent
80a1500634
commit
f6d1a27f51
@ -103,7 +103,11 @@ export default class SyncTargetOneDrive extends BaseSyncTarget {
|
|||||||
}
|
}
|
||||||
this.api_.setAccountProperties(accountProperties);
|
this.api_.setAccountProperties(accountProperties);
|
||||||
const appDir = await this.api().appDirectory();
|
const appDir = await this.api().appDirectory();
|
||||||
const fileApi = new FileApi(appDir, new FileApiDriverOneDrive(this.api()));
|
// the appDir might contain non-ASCII characters
|
||||||
|
// /[^\u0021-\u00ff]/ is used in Node.js to detect the unescaped characters.
|
||||||
|
// See https://github.com/nodejs/node/blob/bbbf97b6dae63697371082475dc8651a6a220336/lib/_http_client.js#L176
|
||||||
|
const baseDir = RegExp(/[^\u0021-\u00ff]/).exec(appDir) !== null ? encodeURI(appDir) : appDir;
|
||||||
|
const fileApi = new FileApi(baseDir, new FileApiDriverOneDrive(this.api()));
|
||||||
fileApi.setSyncTargetId(this.syncTargetId());
|
fileApi.setSyncTargetId(this.syncTargetId());
|
||||||
fileApi.setLogger(this.logger());
|
fileApi.setLogger(this.logger());
|
||||||
return fileApi;
|
return fileApi;
|
||||||
|
Loading…
Reference in New Issue
Block a user