web: Added interval checking for nos2x
This commit is contained in:
parent
72346522eb
commit
ef1c2ca525
2 changed files with 21 additions and 4 deletions
|
@ -120,6 +120,26 @@ function notice_chatroom(state, id)
|
|||
}
|
||||
|
||||
async function damus_web_init()
|
||||
{
|
||||
init_message_textareas();
|
||||
|
||||
let tries = 0;
|
||||
function init() {
|
||||
// only wait for 500ms max
|
||||
const max_wait = 500
|
||||
const interval = 20
|
||||
if (window.nostr || tries >= (max_wait/interval)) {
|
||||
console.info("init after", tries);
|
||||
damus_web_init_ready();
|
||||
return;
|
||||
}
|
||||
tries++;
|
||||
setTimeout(init, interval);
|
||||
}
|
||||
init();
|
||||
}
|
||||
|
||||
async function damus_web_init_ready()
|
||||
{
|
||||
const model = init_home_model()
|
||||
DAMUS = model
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue