diff --git a/README.md b/README.md index a02515b..453a539 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Simply edit index.html and replace `wss://mindmachine.688.org` with `ws://127.0. If you are running the mindmachine on Windows using WSL2: 0. Change config.yaml. Set websocketaddr to `0.0.0.0:1031` (originally `127.0.0.1:1031`) -1. Run`ip a |grep "global eth0` and you will get `inet xxx.xxx.xxx.xxx/20 brd aaa.aaa.aaa.aaa scope global eth0` +1. Run`ip a |grep "global eth0“` and you will get `inet xxx.xxx.xxx.xxx/20 brd aaa.aaa.aaa.aaa scope global eth0` 2. Edit index.html, replace `wss://mindmachine.688.org` with `ws://xxx.xxx.xxx.xxx:1031` 3. Open index.html ### Contributing diff --git a/index.html b/index.html index 867bb5a..d4424a3 100644 --- a/index.html +++ b/index.html @@ -514,6 +514,9 @@ case 641851: kindReady = true break; + case 640497: + identityReady = true + break; } } } diff --git a/samizdat.js b/samizdat.js index 4440cb3..8e991d2 100644 --- a/samizdat.js +++ b/samizdat.js @@ -10,6 +10,16 @@ function waitForSamizdatReady(callback) { } }, 200); } +let identityReady = false +function waitForIdentityReady(callback) { + var interval = setInterval(function() { + if (identityReady) { + clearInterval(interval); + callback(); + } + }, 200); +} + function displaySamizdat() { document.getElementById("maincontent").replaceChildren(prepWindow()) @@ -17,9 +27,12 @@ function displaySamizdat() { document.getElementById("heading").appendChild(spacer()) document.getElementById("content").replaceChildren(loadingSign()) waitForSamizdatReady(function () { - getMuhPubkey().then(pubkey => { - document.getElementById("heading").appendChild(helpButton("58b02c07e1971ad9178293e0c0d39509a715db35ba3a989ed97d25c6f8e9ad07", pubkey)) - renderSamizdat(pubkey) + waitForIdentityReady(function () { + getMuhPubkey().then(pubkey => { + document.getElementById("heading").appendChild(helpButton("58b02c07e1971ad9178293e0c0d39509a715db35ba3a989ed97d25c6f8e9ad07", pubkey)) + renderSamizdat(pubkey) + } + ) }) }) rewriteURL("samizdat")