contented: fix upload item disappearing once logged in

This commit is contained in:
mappu 2017-10-15 22:55:00 +13:00
parent c2de4c8d45
commit 89c8cb0dc8

View File

@ -690,6 +690,13 @@ var menu = new MenuList(el("#menubutton"));
menu.reset = function() { menu.reset = function() {
this.clear(); this.clear();
if (contented_url.length > 0) {
menu.add("Upload", function() {
contented_load();
});
}
this.add(joinparts_getstr(), toggle_joinparts); this.add(joinparts_getstr(), toggle_joinparts);
this.add(desktop_notifications_fmtstr(), desktop_notifications_toggle); this.add(desktop_notifications_fmtstr(), desktop_notifications_toggle);
this.add(warnonclose_fmtstr(), warnonclose_toggle); this.add(warnonclose_fmtstr(), warnonclose_toggle);
@ -1176,9 +1183,7 @@ window.onload = function() {
}); });
sock.on('contented', function(url) { sock.on('contented', function(url) {
contented_url = url; contented_url = url;
menu.add("Upload", function() { menu.reset(); // sent before login
contented_load();
});
}); });
}; };