1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

All: Filter to sync target and refactored so that same code can be used by all clients

This commit is contained in:
Laurent Cozic
2017-12-05 19:21:01 +00:00
parent c703521b6c
commit 03ec406627
3 changed files with 30 additions and 43 deletions

View File

@ -383,8 +383,8 @@ class BaseItem extends BaseModel {
throw new Error('Invalid type: ' + type);
}
static async syncDisabledItems() {
const rows = await this.db().selectAll('SELECT * FROM sync_items WHERE sync_disabled = 1');
static async syncDisabledItems(syncTargetId) {
const rows = await this.db().selectAll('SELECT * FROM sync_items WHERE sync_disabled = 1 AND sync_target = ?', [syncTargetId]);
let output = [];
for (let i = 0; i < rows.length; i++) {
const item = await this.loadItem(rows[i].item_type, rows[i].item_id);