Hotfix for double nos2x prompt

This commit is contained in:
Thomas Mathews 2023-01-06 21:13:13 -08:00
parent dde0a06e56
commit a7a32ce57b
2 changed files with 12 additions and 11 deletions

View file

@ -121,9 +121,16 @@ function on_timer_timestamps() {
} }
function on_timer_invalidations() { function on_timer_invalidations() {
setTimeout(() => { const model = DAMUS;
if (DAMUS.invalidated.length > 0) setTimeout(async () => {
view_timeline_update(DAMUS); if (model.dms_need_redraw && view_get_timeline_el().dataset.mode == VM_DM) {
// if needs decryption do it
await decrypt_dms(model);
view_dm_update(model);
model.dms_need_redraw = false;
}
if (model.invalidated.length > 0)
view_timeline_update(model);
on_timer_invalidations(); on_timer_invalidations();
}, 50); }, 50);
} }
@ -140,12 +147,6 @@ function on_timer_save() {
function on_timer_tick() { function on_timer_tick() {
const model = DAMUS; const model = DAMUS;
setTimeout(async () => { setTimeout(async () => {
if (model.dms_need_redraw && view_get_timeline_el().dataset.mode == VM_DM) {
// if needs decryption do it
await decrypt_dms(model);
view_dm_update(model);
model.dms_need_redraw = false;
}
update_notifications(model); update_notifications(model);
model.relay_que.forEach((que, relay) => { model.relay_que.forEach((que, relay) => {
model_fetch_next_profile(model, relay); model_fetch_next_profile(model, relay);

View file

@ -117,8 +117,8 @@ function view_timeline_apply_mode(model, mode, opts={}, push_state=true) {
el_their_pfp.dataset.pubkey = pubkey; el_their_pfp.dataset.pubkey = pubkey;
break; break;
case VM_DM: case VM_DM:
decrypt_dms(model); //decrypt_dms(model);
view_dm_update(model); //view_dm_update(model);
break; break;
case VM_SETTINGS: case VM_SETTINGS:
view_show_spinner(false); view_show_spinner(false);