Manage expired channels

This commit is contained in:
yflory
2018-02-13 18:20:13 +01:00
parent 8f7489576f
commit 728a6a868d
13 changed files with 120 additions and 11 deletions

View File

@@ -709,6 +709,7 @@ define([
typing = 1;
$spin.text(Messages.typing);
$spin.interval = window.setInterval(function () {
if (toolbar.isErrorState) { return; }
var dots = Array(typing+1).join('.');
$spin.text(Messages.typing + dots);
typing++;
@@ -718,6 +719,7 @@ define([
var onSynced = function () {
if ($spin.timeout) { clearTimeout($spin.timeout); }
$spin.timeout = setTimeout(function () {
if (toolbar.isErrorState) { return; }
window.clearInterval($spin.interval);
typing = -1;
$spin.text(Messages.saved);
@@ -1094,6 +1096,15 @@ define([
}
};
// When the pad is deleted from the server
toolbar.deleted = function (/*userId*/) {
toolbar.isErrorState = true;
toolbar.connected = false;
if (toolbar.spinner) {
toolbar.spinner.text(Messages.deletedFromServer);
}
};
// On log out, remove permanently the realtime elements of the toolbar
Common.onLogout(function () {
failed();