fix peercount & relays

This commit is contained in:
Naiel
2025-12-12 16:06:52 +01:00
committed by GitHub
parent 33594b2508
commit 0366f62dfb
3 changed files with 12 additions and 9 deletions

View File

@@ -144,6 +144,7 @@ function fixGunLocalStorage() {
function betterGunPut(ref, data) {
ref.put(data, (ack) => {
if (ack.err) {
console.error("Ack failure", ack)
toastr.error(
ack.err + "<br>Pulsa aqui para reiniciar la app",
"Error al guardar", { onclick: () => fixGunLocalStorage() }

View File

@@ -24,13 +24,15 @@ const RELAYS = [
// "https://gun-es05.tech.eus/gun",
// "https://gun-es06.tech.eus/gun",
// "https://gun-es07.tech.eus/gun", // No he podido instalar el nodo.
"https://gun-manhattan.herokuapp.com/gun",
"https://peer.wallie.io/gun",
"https://gundb-relay-mlccl.ondigitalocean.app/gun",
"https://plankton-app-6qfp3.ondigitalocean.app/",
"https://gun.defucc.me/gun",
"https://gun.o8.is/gun",
"https://shogun-relay.scobrudot.dev/gun",
// Desactivado por fallos:
// "https://gun-manhattan.herokuapp.com/gun",
// "https://peer.wallie.io/gun",
// "https://gundb-relay-mlccl.ondigitalocean.app/gun",
// "https://plankton-app-6qfp3.ondigitalocean.app/",
// "https://gun.defucc.me/gun",
// "https://gun.o8.is/gun",
// "https://shogun-relay.scobrudot.dev/gun",
];
var SECRET = "";
var SUB_LOGGED_IN = false;

View File

@@ -51,13 +51,13 @@ function createPeerListElement(wireHType, wireID) {
}
function updateConnectionStatus(peerCount) {
var statusImage = peerCount < 3 ? "connect_ko.svg" : "connect_ok.svg";
var statusImage = peerCount < 1 ? "connect_ko.svg" : "connect_ok.svg";
if (window.navigator.onLine == false) {
statusImage = "offline.svg"
}
document.getElementById("connectStatus").src = `static/ico/${statusImage}`;
if (peerCount < 3) {
if (peerCount < 1) {
if (!window.peerRetryCount) window.peerRetryCount = 0;
window.peerRetryCount = (window.peerRetryCount + 1) % 3;
if (window.peerRetryCount === 0) {