mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-12-04 11:34:44 +01:00
feat: allow to disable preventUnload in dev (#9319)
* feat: allow to disable preventUnload in dev * add template
This commit is contained in:
@@ -608,7 +608,13 @@ const ExcalidrawWrapper = () => {
|
||||
excalidrawAPI.getSceneElements(),
|
||||
)
|
||||
) {
|
||||
preventUnload(event);
|
||||
if (import.meta.env.VITE_APP_DISABLE_PREVENT_UNLOAD !== "true") {
|
||||
preventUnload(event);
|
||||
} else {
|
||||
console.warn(
|
||||
"preventing unload disabled (VITE_APP_DISABLE_PREVENT_UNLOAD)",
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
window.addEventListener(EVENT.BEFORE_UNLOAD, unloadHandler);
|
||||
|
||||
Reference in New Issue
Block a user