From 018f6692a988bb8a2d9cf86ff27c621e96a937f7 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sun, 29 Mar 2020 18:49:51 -0500 Subject: [PATCH] don't refresh boards if doc hidden --- static-data/default_config.json | 16 ++++++++-------- static-data/www/board/autorefresh.js | 20 +++++++++++++++++++- tests/runtime-result.txt | 2 +- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/static-data/default_config.json b/static-data/default_config.json index 94a27fbf..453b69e1 100755 --- a/static-data/default_config.json +++ b/static-data/default_config.json @@ -7,16 +7,16 @@ }, "general": { "announce_node": true, - "dev_mode": true, + "dev_mode": false, "display_header": true, "ephemeral_tunnels": false, "hide_created_blocks": true, - "insert_deniable_blocks": false, + "insert_deniable_blocks": true, "max_block_age": 2678400, - "minimum_block_pow": 1, - "minimum_send_pow": 1, + "minimum_block_pow": 5, + "minimum_send_pow": 5, "public_key": "", - "random_bind_ip": false, + "random_bind_ip": true, "security_level": 0, "show_notifications": true, "store_plaintext_blocks": true, @@ -30,12 +30,12 @@ }, "file": { "output": true, - "remove_on_exit": false + "remove_on_exit": true }, "verbosity": "default" }, "onboarding": { - "done": true + "done": false }, "peers": { "max_connect": 1000, @@ -64,7 +64,7 @@ "transports": { "lan": true, "manual_disk": true, - "tor": false + "tor": true }, "ui": { "theme": "dark" diff --git a/static-data/www/board/autorefresh.js b/static-data/www/board/autorefresh.js index d68ada23..066ef301 100644 --- a/static-data/www/board/autorefresh.js +++ b/static-data/www/board/autorefresh.js @@ -1,6 +1,24 @@ +/* + Onionr - Private P2P Communication + + Auto refresh board posts + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ var checkbox = document.getElementById('refreshCheckbox') function autoRefresh(){ - if (! checkbox.checked){return} + if (! checkbox.checked || document.hidden){return} getBlocks() } diff --git a/tests/runtime-result.txt b/tests/runtime-result.txt index d19f62b1..0a2bb8a5 100644 --- a/tests/runtime-result.txt +++ b/tests/runtime-result.txt @@ -1 +1 @@ -1585212325 \ No newline at end of file +1585525008 \ No newline at end of file