From aeaf7d19507090f37e3a5860324849ee90e57ab4 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 11 Jun 2018 15:06:43 +0200 Subject: [PATCH] Fix mediatag... --- www/common/common-ui-elements.js | 4 +++- www/common/media-tag.js | 2 +- www/common/outer/upload.js | 4 +--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 04c9db22e..8e0a7b9e4 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1065,7 +1065,9 @@ define([ childList: true, characterData: false }); - MediaTag($tag[0]); + MediaTag($tag[0]).on('error', function (data) { + console.error(data); + }); }; var emoji_patt = /([\uD800-\uDBFF][\uDC00-\uDFFF])/; diff --git a/www/common/media-tag.js b/www/common/media-tag.js index 79f48e8ea..b84629ec8 100644 --- a/www/common/media-tag.js +++ b/www/common/media-tag.js @@ -211,7 +211,7 @@ if (e) { return setTimeout(function () { done(e); }); } if (plaintext) { - if (i * cypherChunkLength < u8.length) { // not done + if ((i * cypherChunkLength + 2 + metadataLength) < u8.length) { // not done chunks.push(plaintext); return again(); } diff --git a/www/common/outer/upload.js b/www/common/outer/upload.js index 65f674517..ef571af57 100644 --- a/www/common/outer/upload.js +++ b/www/common/outer/upload.js @@ -11,9 +11,7 @@ define([ var u8 = file.blob; // This is not a blob but a uint8array var metadata = file.metadata; - var owned = file.isOwned; -// XXX -owned = true; + var owned = file.owned; // if it exists, path contains the new pad location in the drive var path = file.path;