Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Best way for patching goto()? Unsaved data // onbeforeunload logic #1040

Open
@SARFEX

Description

@SARFEX

Hey Sapper Community ❤️
I do:

async function gotoURL(...args) {
	if (isFormUnsaved === true){
		if (window.confirm("Are we leaving already?") === false){
			return false;
		}
	}
	return await goto(...args);
}

And it works for on:click.
How can I "patch" goto, for real links <a href="/somewhere">Meow</a>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions