Skip to content

Commit 1d0d71d

Browse files
authored
Merge pull request #155 from GursheenK/route-issues
fix: properly parsing newly added slide + route issue
2 parents fa6f093 + 2b1205f commit 1d0d71d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

frontend/src/pages/PresentationEditor.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ watch(
270270
watch(
271271
() => route.name,
272272
(name) => {
273+
if (!['EditorNew', 'PresentationEditor'].includes(name)) return
273274
inReadonlyMode.value = props.editorAccess == 'view'
274275
if (name === 'EditorNew') {
275276
resetEditorState()

frontend/src/stores/slide.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ const getNewSlide = (toDuplicate = false, layoutObject) => {
202202
}))
203203
} else {
204204
layout = layoutObject || null
205-
layout.elements = JSON.parse(layout?.elements || [])
205+
layout.elements =
206+
typeof layout?.elements === 'string'
207+
? JSON.parse(layout.elements)
208+
: layout?.elements || []
206209
}
207210

208211
let slide = {}

0 commit comments

Comments
 (0)