Skip to content

Commit

Permalink
Workaround: Ignore discard changes when in a workspace modal (#2481)
Browse files Browse the repository at this point in the history
ignore discard changes when in a workspace modal
  • Loading branch information
madsrasmussen authored Oct 24, 2024
1 parent b9f680a commit d7cf61d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ export abstract class UmbEntityDetailWorkspaceContextBase<
#onWillNavigate = async (e: CustomEvent) => {
const newUrl = e.detail.url;

/* TODO: temp removal of discard changes in workspace modals.
The modal closes before the discard changes dialog is resolved.*/
if (newUrl.includes('/modal/umb-modal-workspace/')) {
return true;
}

if (this._checkWillNavigateAway(newUrl) && this._data.getHasUnpersistedChanges()) {
e.preventDefault();
const modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT);
Expand Down

0 comments on commit d7cf61d

Please sign in to comment.