1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-27 10:32:58 +02:00
joplin/ReactNativeClient/lib/SyncTargetMemory.js

37 lines
852 B
JavaScript
Raw Normal View History

const BaseSyncTarget = require('lib/BaseSyncTarget.js');
const Setting = require('lib/models/Setting').default;
const { FileApi } = require('lib/file-api.js');
const { FileApiDriverMemory } = require('lib/file-api-driver-memory.js');
const Synchronizer = require('lib/Synchronizer').default;
2017-11-24 21:09:15 +02:00
class SyncTargetMemory extends BaseSyncTarget {
static id() {
return 1;
}
static targetName() {
return 'memory';
}
static label() {
return 'Memory';
}
2018-03-26 19:33:55 +02:00
async isAuthenticated() {
return true;
}
initFileApi() {
const fileApi = new FileApi('/root', new FileApiDriverMemory());
fileApi.setLogger(this.logger());
2017-11-24 21:09:15 +02:00
fileApi.setSyncTargetId(SyncTargetMemory.id());
return fileApi;
}
async initSynchronizer() {
return new Synchronizer(this.db(), await this.fileApi(), Setting.value('appType'));
}
}
2019-07-29 15:43:53 +02:00
module.exports = SyncTargetMemory;