1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Mobile: Support building for web (#10650)

This commit is contained in:
Henry Heino
2024-08-02 06:51:49 -07:00
committed by GitHub
parent 88271bf1a7
commit f69dffcf23
157 changed files with 6251 additions and 1325 deletions

View File

@@ -26,18 +26,29 @@ export default class SyncTargetFilesystem extends BaseSyncTarget {
return true;
}
private syncPath_() {
return Setting.value('sync.2.path');
}
public async initFileApi() {
const syncPath = Setting.value('sync.2.path');
const driver = new FileApiDriverLocal();
const fileApi = new FileApi(syncPath, driver);
const fileApi = new FileApi(() => {
// The sync path can be set by the user after startup, so needs to be
// determined dynamically.
return this.syncPath_();
}, driver);
fileApi.setLogger(this.logger());
fileApi.setSyncTargetId(SyncTargetFilesystem.id());
const syncPath = this.syncPath_();
await driver.mkdir(syncPath);
return fileApi;
}
public async initSynchronizer() {
return new Synchronizer(this.db(), await this.fileApi(), Setting.value('appType'));
const api = await this.fileApi();
return new Synchronizer(this.db(), api, Setting.value('appType'));
}
}