mirror of https://github.com/xwiki-labs/cryptpad
Detect placeholder when reading metadata
This commit is contained in:
parent
4d643e51a1
commit
235d5594f7
|
@ -392,7 +392,14 @@ var getDedicatedMetadata = function (env, channelId, handler, _cb) {
|
|||
readMore();
|
||||
}, function (err) {
|
||||
// ENOENT => there is no metadata log
|
||||
if (!err || err.code === 'ENOENT') { return void cb(); }
|
||||
if (!err || err.code === 'ENOENT') {
|
||||
if (err && err.code === 'ENOENT') {
|
||||
return readPlaceholder(env, channelId, (content) => {
|
||||
cb(content);
|
||||
});
|
||||
}
|
||||
return void cb();
|
||||
}
|
||||
// otherwise stream errors?
|
||||
cb(err);
|
||||
});
|
||||
|
|
|
@ -193,6 +193,11 @@ define([
|
|||
finish(Session, void 0, doc);
|
||||
});
|
||||
};
|
||||
|
||||
config.onChannelError = function (info) {
|
||||
finish(Session, info);
|
||||
};
|
||||
|
||||
overwrite(config, opt);
|
||||
|
||||
start(Session, config);
|
||||
|
|
Loading…
Reference in New Issue