You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would love to have support for Promise in $beforeUrlChange.
Currently, in a "form", I look if the form has some changes, and if yes, I show a dialog which returns a promise, that resolves after user's choice of whether to discard the change.
It's pretty neat to wait for that response before I can return the $beforeUrlChange a "true" or "false".
Surprisingly, I am already using an asynchronous function there, but it pops out an incorrect type warning.
I am not sure whether it's merely a fix for the types or actually needs to support in the codebase.
I am happy to provide more details as needed.
The text was updated successfully, but these errors were encountered:
I am with R2, version 2.15.1.
If you ignore VSCode complaining about the type error, it actually works just fine.
-- Here is a sidenote: Routify is amazingly awesome. Thanks to you, Ghost and everyone else involved in the community for active support and amazing ideas.
I have found the issue behind this. The types are automatically generated on build, but the type for beforeUrlChange was added manually in the generated definition file.
I would love to have support for Promise in $beforeUrlChange.
Currently, in a "form", I look if the form has some changes, and if yes, I show a dialog which returns a promise, that resolves after user's choice of whether to discard the change.
It's pretty neat to wait for that response before I can return the $beforeUrlChange a "true" or "false".
Surprisingly, I am already using an asynchronous function there, but it pops out an incorrect type warning.
I am not sure whether it's merely a fix for the types or actually needs to support in the codebase.
I am happy to provide more details as needed.
The text was updated successfully, but these errors were encountered: