diff --git a/src/Ui/UiWebsocket.py b/src/Ui/UiWebsocket.py index 6c556eab..38614a53 100644 --- a/src/Ui/UiWebsocket.py +++ b/src/Ui/UiWebsocket.py @@ -174,7 +174,7 @@ class UiWebsocket: "size_limit": site.getSizeLimit(), "next_size_limit": site.getNextSizeLimit(), "last_downloads": len(site.last_downloads), - "peers": site.settings["peers"], + "peers": site.settings.get("peers", len(site.peers)), "tasks": len([task["inner_path"] for task in site.worker_manager.tasks]), "content": content } diff --git a/src/Ui/media/Wrapper.coffee b/src/Ui/media/Wrapper.coffee index 7a5fa1da..4935b141 100644 --- a/src/Ui/media/Wrapper.coffee +++ b/src/Ui/media/Wrapper.coffee @@ -164,7 +164,7 @@ class Wrapper @log "onLoad" @inner_loaded = true if not @inner_ready then @sendInner {"cmd": "wrapperReady"} # Inner frame loaded before wrapper - if not @site_error then @loading.hideScreen() # Hide loading screen + #if not @site_error then @loading.hideScreen() # Hide loading screen if window.location.hash then $("#inner-iframe")[0].src += window.location.hash # Hash tag if @ws.ws.readyState == 1 and not @site_info # Ws opened @reloadSiteInfo() @@ -226,7 +226,7 @@ class Wrapper @site_error = "No peers found" @loading.printLine "No peers found" - if not @site_info and $("#inner-iframe").attr("src").indexOf("?") == -1 # First site info and mainpage + if not @site_info and not @loading.screen_visible and $("#inner-iframe").attr("src").indexOf("?") == -1 # First site info and mainpage if site_info.size_limit < site_info.next_size_limit # Need upgrade soon @wrapperConfirm "Running out of size limit (#{(site_info.settings.size/1024/1024).toFixed(1)}MB/#{site_info.size_limit}MB)", "Set limit to #{site_info.next_size_limit}MB", => @ws.cmd "siteSetLimit", [site_info.next_size_limit], (res) => diff --git a/src/Ui/media/all.js b/src/Ui/media/all.js index ce25fff7..c29fd146 100644 --- a/src/Ui/media/all.js +++ b/src/Ui/media/all.js @@ -943,9 +943,6 @@ jQuery.extend( jQuery.easing, "cmd": "wrapperReady" }); } - if (!this.site_error) { - this.loading.hideScreen(); - } if (window.location.hash) { $("#inner-iframe")[0].src += window.location.hash; } @@ -1020,7 +1017,7 @@ jQuery.extend( jQuery.easing, this.loading.printLine("No peers found"); } } - if (!this.site_info && $("#inner-iframe").attr("src").indexOf("?") === -1) { + if (!this.site_info && !this.loading.screen_visible && $("#inner-iframe").attr("src").indexOf("?") === -1) { if (site_info.size_limit < site_info.next_size_limit) { this.wrapperConfirm("Running out of size limit (" + ((site_info.settings.size / 1024 / 1024).toFixed(1)) + "MB/" + site_info.size_limit + "MB)", "Set limit to " + site_info.next_size_limit + "MB", (function(_this) { return function() {