curls/server/static/dashboard/js/main/storage.js

24 lines
525 B
JavaScript
Raw Normal View History

2024-08-02 04:12:44 +00:00
class Storage {
static debouncer_delay = 250
static setup = () => {
this.debouncer = Utils.create_debouncer((key) => {
this.do_check(key)
}, this.debouncer_delay)
window.addEventListener(`storage`, (e) => {
this.check(e.key)
})
}
static check = (key) => {
this.debouncer.call(key)
}
static do_check = (key) => {
if (key.startsWith(`curls_data`)) {
Curls.fill_colors()
Update.update()
}
}
}