Is it possible to prompt the user for confirmation using the confirm()
function?
Currently, I am monitoring when the user is changing routes with this code snippet:
import { navigating } from '$app/stores';
$: if($navigating) alert('changing route');
The issue arises when the route changes at the same time as the alert message. How can I prevent the route change until the user has confirmed by clicking okay in the confirm()
dialog?