From 6e12fc1c09d47036166ccab0a6ab653e8e359e9b Mon Sep 17 00:00:00 2001 From: David Benson Date: Fri, 20 Oct 2023 13:34:57 +0100 Subject: [PATCH] 22.0.6 release --- src/main/webapp/plugins/nextcloud.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/plugins/nextcloud.js b/src/main/webapp/plugins/nextcloud.js index 255e8b746..308650be9 100644 --- a/src/main/webapp/plugins/nextcloud.js +++ b/src/main/webapp/plugins/nextcloud.js @@ -543,21 +543,27 @@ Draw.loadPlugin(function(ui) ui.installMessageHandler = function(callback) { - origInstallMessageHandler.call(this, function() + origInstallMessageHandler.call(this, function(xml, evt) { + try + { + // New empty files + if (JSON.parse(evt.data).xml == ' ') return; + } + catch (e) {} // Ignore + callback.apply(this, arguments); var file = ui.getCurrentFile(); loadDescriptor = loadDescriptor || {}; - + // New files call this twice, so we need to check if the file is loaded if (!loadDescriptor.isLoaded) { + loadDescriptor.isLoaded = true; file.setDescriptor(loadDescriptor); ui.fileLoaded(file, true); } - - loadDescriptor.isLoaded = true; }); }