Skip to content

Commit

Permalink
Revert to original dirty state fix
Browse files Browse the repository at this point in the history
Before merging #9203, I refactored it to use a `$nextTick` which I thought worked at the time but didn't.
  • Loading branch information
duncanmcclean committed Dec 15, 2023
1 parent 4ba8754 commit eb6b610
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions resources/js/components/entries/PublishForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,10 @@ export default {
.then(() => {
// If revisions are enabled, just emit event.
if (this.revisionsEnabled) {
this.trackDirtyState = false;
clearTimeout(this.trackDirtyStateTimeout)
this.trackDirtyState = false
this.values = this.resetValuesFromResponse(response.data.data.values);
this.nextTick(() => this.trackDirtyState = true);
this.trackDirtyStateTimeout = setTimeout(() => (this.trackDirtyState = true), 350)
this.$nextTick(() => this.$emit('saved', response));
return;
}
Expand All @@ -588,9 +589,10 @@ export default {
// the hooks are resolved because if this form is being shown in a stack, we only
// want to close it once everything's done.
else {
clearTimeout(this.trackDirtyStateTimeout);
this.trackDirtyState = false;
this.values = this.resetValuesFromResponse(response.data.data.values);
this.nextTick(() => this.trackDirtyState = true);
this.trackDirtyStateTimeout = setTimeout(() => (this.trackDirtyState = true), 350);
this.initialPublished = response.data.data.published;
this.activeLocalization.published = response.data.data.published;
this.activeLocalization.status = response.data.data.status;
Expand Down

0 comments on commit eb6b610

Please sign in to comment.