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

All: Add support for application plugins (#3257)

This commit is contained in:
Laurent
2020-10-09 18:35:46 +01:00
committed by GitHub
parent 833fb1264f
commit fe41d37f8f
804 changed files with 95622 additions and 5307 deletions

View File

@ -3,8 +3,9 @@ const BaseModel = require('lib/BaseModel');
const MasterKey = require('lib/models/MasterKey');
const Resource = require('lib/models/Resource');
const ResourceService = require('lib/services/ResourceService');
const { Logger } = require('lib/logger.js');
const Logger = require('lib/Logger').default;
const EventEmitter = require('events');
const shim = require('lib/shim').default;
class DecryptionWorker {
constructor() {
@ -64,7 +65,7 @@ class DecryptionWorker {
async scheduleStart() {
if (this.scheduleId_) return;
this.scheduleId_ = setTimeout(() => {
this.scheduleId_ = shim.setTimeout(() => {
this.scheduleId_ = null;
this.start({
masterKeyNotLoadedHandler: 'dispatch',
@ -280,16 +281,16 @@ class DecryptionWorker {
async destroy() {
this.eventEmitter_.removeAllListeners();
if (this.scheduleId_) {
clearTimeout(this.scheduleId_);
shim.clearTimeout(this.scheduleId_);
this.scheduleId_ = null;
}
this.eventEmitter_ = null;
DecryptionWorker.instance_ = null;
return new Promise((resolve) => {
const iid = setInterval(() => {
const iid = shim.setInterval(() => {
if (!this.startCalls_.length) {
clearInterval(iid);
shim.clearInterval(iid);
resolve();
}
}, 100);