Prevent multiple concurrent clicks to get the history
This commit is contained in:
@@ -75,6 +75,8 @@ define([
|
|||||||
|
|
||||||
var create = History.create = function (common, config) {
|
var create = History.create = function (common, config) {
|
||||||
if (!config.$toolbar) { return void console.error("config.$toolbar is undefined");}
|
if (!config.$toolbar) { return void console.error("config.$toolbar is undefined");}
|
||||||
|
if (History.loading) { return void console.error("History is already being loaded..."); }
|
||||||
|
History.loading = true;
|
||||||
var $toolbar = config.$toolbar;
|
var $toolbar = config.$toolbar;
|
||||||
var noFunc = function () {};
|
var noFunc = function () {};
|
||||||
var render = config.onRender || noFunc;
|
var render = config.onRender || noFunc;
|
||||||
@@ -210,6 +212,7 @@ define([
|
|||||||
|
|
||||||
// Load all the history messages into a new chainpad object
|
// Load all the history messages into a new chainpad object
|
||||||
loadHistory(common, function (err, newRt) {
|
loadHistory(common, function (err, newRt) {
|
||||||
|
History.loading = false;
|
||||||
if (err) { throw new Error(err); }
|
if (err) { throw new Error(err); }
|
||||||
realtime = newRt;
|
realtime = newRt;
|
||||||
update();
|
update();
|
||||||
|
|||||||
Reference in New Issue
Block a user