From a07d1722fc6532d5497bccac63f9196717ebce34 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 30 Dec 2014 12:12:24 +0100 Subject: [PATCH] no errors on chrome client --- src/node/handler/ImportHandler.js | 15 +++++++++++---- src/static/js/pad_impexp.js | 4 ++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/node/handler/ImportHandler.js b/src/node/handler/ImportHandler.js index 14cc10194..a511637cc 100644 --- a/src/node/handler/ImportHandler.js +++ b/src/node/handler/ImportHandler.js @@ -247,9 +247,16 @@ exports.doImport = function(req, res, padId) padManager.getPad(padId, function(err, _pad){ var pad = _pad; padManager.unloadPad(padId); - padMessageHandler.updatePadClients(pad, function(){ + + // direct Database Access means a pad user should perform a switchToPad + // and not attempt to recieve updated pad data.. + if(!directDatabaseAccess){ + padMessageHandler.updatePadClients(pad, function(){ + callback(); + }); + }else{ callback(); - }); + } }); }, @@ -282,7 +289,7 @@ exports.doImport = function(req, res, padId) } ERR(err); - + //close the connection res.send( " \ @@ -293,7 +300,7 @@ exports.doImport = function(req, res, padId) if(navigator.userAgent.indexOf('MSIE') === -1){ \ document.domain = document.domain; \ } \ - var impexp = window.parent.padimpexp.handleFrameCall('" + status + "'); \ + var impexp = window.parent.padimpexp.handleFrameCall('" + directDatabaseAccess +"', '" + status + "'); \ }) \ " , 200); diff --git a/src/static/js/pad_impexp.js b/src/static/js/pad_impexp.js index d9a8953d2..77f1eb289 100644 --- a/src/static/js/pad_impexp.js +++ b/src/static/js/pad_impexp.js @@ -237,13 +237,13 @@ var padimpexp = (function() $('#importform').submit(fileInputSubmit); $('.disabledexport').click(cantExport); }, - handleFrameCall: function(status) + handleFrameCall: function(directDatabaseAccess, status) { if (status !== "ok") { importFailed(status); } - + if(directDatabaseAccess) pad.switchToPad(clientVars.padId); importDone(); }, disable: function()