Skip to content

Commit aa57ea9

Browse files
committed
fix: discard changes redirect
1 parent 8c6aca6 commit aa57ea9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

client/components/editor.vue

+6-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
v-icon(color='blue', :left='$vuetify.breakpoint.lgAndUp') sort_by_alpha
2020
span.white--text(v-if='$vuetify.breakpoint.lgAndUp') {{ $t('editor:page') }}
2121
v-btn(
22-
v-if='mode === `create` && path !== `home`'
22+
v-if='path !== `home`'
2323
outline
2424
color='red'
2525
:class='{ "is-icon": $vuetify.breakpoint.mdAndDown }'
@@ -29,9 +29,6 @@
2929
span.white--text(v-if='$vuetify.breakpoint.lgAndUp') {{ $t('common:actions.discard') }}
3030
v-content
3131
component(:is='currentEditor')
32-
v-btn(fixed, bottom, right, color='red', round, @click='exit', dark)
33-
v-icon(left) close
34-
span Close Editor
3532
editor-modal-properties(v-model='dialogProps')
3633
editor-modal-editorselect(v-model='dialogEditorSelector')
3734
editor-modal-unsaved(v-model='dialogUnsaved', @discard='exitGo')
@@ -265,7 +262,11 @@ export default {
265262
this.$store.commit(`loadingStart`, 'editor-close')
266263
this.currentEditor = ''
267264
_.delay(() => {
268-
window.location.assign(`/${this.$store.get('page/path')}`)
265+
if (this.$store.get('editor/mode') === 'create') {
266+
window.location.assign(`/`)
267+
} else {
268+
window.location.assign(`/${this.$store.get('page/path')}`)
269+
}
269270
}, 500)
270271
}
271272
}

0 commit comments

Comments
 (0)