Skip to content

Commit

Permalink
auto-update keys on SD inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
MathJud committed Jul 31, 2024
1 parent 1b39f8f commit f791a9b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions demo/playground/sd_inspector.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@
window.addEventListener('wasm_ready', function(){
console.log('WASM is ready')

// load keys from WASM
keys = new Keys()
});

// update domains on key change
window.addEventListener('keys_ready', function(){
domains.keys_updated(keys.keys)
// set interval for key reload
setInterval(update_keys, 5000)
})
window.addEventListener('keys_updated', function(){
domains.keys_updated(keys.keys)
Expand All @@ -46,6 +49,11 @@
update_ui_domains()
})

/// update keys from local storage
function update_keys() {
keys.update_keys()
}

/// update domains
function update_ui_domains() {
for (let i=0; i<domains.domains.length; i++) {
Expand Down

0 comments on commit f791a9b

Please sign in to comment.