window.__TAURI__.dialog causes app to freeze (sometimes)

My code is here: Project time logger (Tauri GUI)

But how can it be a deadlock? The Rust code works without that one line in JS