From 676178c0bbb726e6c08a7ad2f245dfb5e0feaa7f Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 29 Mar 2021 11:41:23 +0200 Subject: [PATCH] Fix title reset in polls --- www/poll/inner.js | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/www/poll/inner.js b/www/poll/inner.js index 5d31d917d..a65a7b1c8 100644 --- a/www/poll/inner.js +++ b/www/poll/inner.js @@ -1166,6 +1166,7 @@ define([ var $drawer = APP.toolbar.$drawer; metadataMgr.onChange(function () { + if (!APP.proxy) { return; } var md = copyObject(metadataMgr.getMetadata()); APP.proxy.metadata = md; }); @@ -1365,23 +1366,23 @@ define([ $('#cp-app-poll-comments-add-title').remove(); } - var rt = APP.rt = Listmap.create(listmapConfig); - APP.proxy = rt.proxy; + common.getPadAttribute('userid', function (e, userid) { + if (e) { console.error(e); } + var rt = APP.rt = Listmap.create(listmapConfig); + APP.proxy = rt.proxy; - var firstConnection = true; - rt.proxy.on('create', onCreate) - .on('ready', function (info) { - if (!firstConnection) { return; } // TODO fix this issue in listmap - firstConnection = false; - common.getPadAttribute('userid', function (e, userid) { - if (e) { console.error(e); } + var firstConnection = true; + rt.proxy.on('create', onCreate) + .on('ready', function (info) { + if (!firstConnection) { return; } // TODO fix this issue in listmap + firstConnection = false; APP.userid = userid; onReady(info, userid); - }); - }) - .on('disconnect', onDisconnect) - .on('reconnect', onReconnect) - .on('error', onError); + }) + .on('disconnect', onDisconnect) + .on('reconnect', onReconnect) + .on('error', onError); + }); }); }; main();