Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent unsaved changes dialog from appearing after item is deleted #8158

Merged
merged 1 commit into from Sep 20, 2021

Conversation

azrikahar
Copy link
Contributor

fixes #8146

Reported Bug

When there's unsaved edits and the item is deleted, the unsaved changes dialog still shows up despite the item already cease to exist:

RZ6Ykm1fkc

Solution

Clear the edits state after item is deleted. Basically referred the edits.value = {} usage from discardAndLeave():

function discardAndLeave() {
if (!leaveTo.value) return;
edits.value = {};
confirmLeave.value = false;
router.push(leaveTo.value);
}

After fix

6luWlSSC8X

@azrikahar azrikahar self-assigned this Sep 20, 2021
@azrikahar azrikahar added the App label Sep 20, 2021
@rijkvanzanten rijkvanzanten added this to the v9.0.0-rc.94 milestone Sep 20, 2021
@rijkvanzanten rijkvanzanten merged commit e81b54e into directus:main Sep 20, 2021
@azrikahar azrikahar deleted the issue-8146 branch September 21, 2021 00:45
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants