Clean images in onlyoffice

This commit is contained in:
yflory 2020-01-22 15:47:12 +01:00
parent ad94e97444
commit 6fd079bfb0
1 changed files with 16 additions and 14 deletions

View File

@ -678,7 +678,7 @@ define([
var m = metadataMgr.getChannelMembers().slice().filter(function (nId) { var m = metadataMgr.getChannelMembers().slice().filter(function (nId) {
return nId.length === 32; return nId.length === 32;
}); });
if (m.length === 1 && !APP.loadingImage) { if (m.length === 1 && APP.loadingImage <= 0) {
try { try {
var docs = window.frames[0].AscCommon.g_oDocumentUrls.urls || {}; var docs = window.frames[0].AscCommon.g_oDocumentUrls.urls || {};
var mediasSources = getMediasSources(); var mediasSources = getMediasSources();
@ -867,6 +867,7 @@ define([
return void callback(""); return void callback("");
} }
try {
var blobUrl = URL.createObjectURL(res.content); var blobUrl = URL.createObjectURL(res.content);
// store media blobUrl and content for cache and export // store media blobUrl and content for cache and export
var mediaData = { blobUrl : blobUrl, content : "" }; var mediaData = { blobUrl : blobUrl, content : "" };
@ -880,6 +881,7 @@ define([
debug("Adding CryptPad Image " + data.name + ": " + blobUrl); debug("Adding CryptPad Image " + data.name + ": " + blobUrl);
window.frames[0].AscCommon.g_oDocumentUrls.addImageUrl(data.name, blobUrl); window.frames[0].AscCommon.g_oDocumentUrls.addImageUrl(data.name, blobUrl);
callback(blobUrl); callback(blobUrl);
} catch (e) {}
}); });
} catch (e) { } catch (e) {
APP.loadingImage--; APP.loadingImage--;