Give notification to all connected clients about ZeroNet update

This commit is contained in:
shortcutme 2019-04-10 14:56:47 +02:00
parent ac799a60da
commit 31372e269d
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -1096,8 +1096,16 @@ class UiWebsocket(object):
def actionServerUpdate(self, to): def actionServerUpdate(self, to):
def cbServerUpdate(res): def cbServerUpdate(res):
self.response(to, "ok") self.response(to, res)
self.cmd("updating") if not res:
return False
for websocket in self.server.websockets:
websocket.cmd(
"notification",
["info", _["Updating ZeroNet client, will be back in a few minutes..."], 20000]
)
websocket.cmd("updating")
sys.modules["main"].update_after_shutdown = True sys.modules["main"].update_after_shutdown = True
SiteManager.site_manager.save() SiteManager.site_manager.save()
sys.modules["main"].file_server.stop() sys.modules["main"].file_server.stop()