mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-21 09:38:01 +02:00
08af9de190
* Started revisions support * More rev changes * More rev changes * More revs changes * Fixed deletion algorithm * More tests and moved updated time to separate field * Display info when restoring note * Better handling of existing notes * wip * Further improvements and fixed tests * Better handling of changes created via sync * Enable chokidar again * Testing special case * Further improved logic to handle notes that existed before the revision service * Added tests * Better handling of encrypted revisions * Improved handling of deleted note revisions by moving logic to collectRevision * Improved handling of old notes by moving logic to collectRevision() * Handle case when deleting revisions while one is still encrypted * UI tweaks * Added revision service to mobile app * Fixed config screens on mobile and desktop * Enabled revisions on CLI app
19 lines
539 B
JavaScript
19 lines
539 B
JavaScript
const Setting = require('lib/models/Setting');
|
|
const ItemChange = require('lib/models/ItemChange');
|
|
|
|
class ItemChangeUtils {
|
|
|
|
static async deleteProcessedChanges() {
|
|
const lastProcessedChangeIds = [
|
|
Setting.value('resourceService.lastProcessedChangeId'),
|
|
Setting.value('searchEngine.lastProcessedChangeId'),
|
|
Setting.value('revisionService.lastProcessedChangeId'),
|
|
];
|
|
|
|
const lowestChangeId = Math.min(...lastProcessedChangeIds);
|
|
await ItemChange.deleteOldChanges(lowestChangeId);
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = ItemChangeUtils; |