diff --git a/resources/js/components/entries/PublishForm.vue b/resources/js/components/entries/PublishForm.vue index eb90849f6b2..e5855691af1 100644 --- a/resources/js/components/entries/PublishForm.vue +++ b/resources/js/components/entries/PublishForm.vue @@ -504,7 +504,7 @@ export default { }, afterSaveOption() { - return this.getPreference('after_save'); + return this.getPreference('after_save') ?? 'listing'; }, originOptions() { @@ -622,8 +622,8 @@ export default { window.location = this.createAnotherUrl; } - // If the user has opted to go to listing (default/null option), redirect them there. - else if (!this.isInline && nextAction === null) { + // If the user has opted to go to listing, redirect them there. + else if (!this.isInline && nextAction === 'listing') { window.location = this.listingUrl; } @@ -794,8 +794,8 @@ export default { window.location = this.createAnotherUrl; } - // If the user has opted to go to listing (default/null option), redirect them there. - else if (!this.isInline && nextAction === null) { + // If the user has opted to go to listing, redirect them there. + else if (!this.isInline && nextAction === 'listing') { window.location = this.listingUrl; } diff --git a/resources/js/components/publish/SaveButtonOptions.vue b/resources/js/components/publish/SaveButtonOptions.vue index 27c7aaf2357..07790da3fcb 100644 --- a/resources/js/components/publish/SaveButtonOptions.vue +++ b/resources/js/components/publish/SaveButtonOptions.vue @@ -92,9 +92,7 @@ export default { setPreference(value) { if (value === this.$preferences.get(this.preferencesKey)) return; - value === 'listing' - ? this.$preferences.remove(this.preferencesKey) - : this.$preferences.set(this.preferencesKey, value); + this.$preferences.set(this.preferencesKey, value); }, }, diff --git a/resources/js/components/terms/PublishForm.vue b/resources/js/components/terms/PublishForm.vue index 15163ce3e6d..9adebbd8013 100644 --- a/resources/js/components/terms/PublishForm.vue +++ b/resources/js/components/terms/PublishForm.vue @@ -399,7 +399,7 @@ export default { }, afterSaveOption() { - return this.getPreference('after_save'); + return this.getPreference('after_save') ?? 'listing'; }, }, @@ -498,8 +498,8 @@ export default { window.location = this.createAnotherUrl; } - // If the user has opted to go to listing (default/null option), redirect them there. - else if (!this.isInline && nextAction === null) { + // If the user has opted to go to listing, redirect them there. + else if (!this.isInline && nextAction === 'listing') { window.location = this.listingUrl; }