Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) => {
Log.create(this._ipfs, this.user.username).then((log) => {
this._logs[channel] = log;
this.events[channel] = new EventEmitter();
if(this.options.cacheFile) {
Cache.loadCache(this.options.cacheFile);
this.sync(channel, Cache.get(channel)).then(() => {
this._state[channel] = false;
resolve();
}).catch(reject);
} else {
resolve();
}
}).catch(reject);
});
}