mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
fix: 修复创建幻灯片再撤销后索引异常的bug
This commit is contained in:
parent
8787c5d5b7
commit
345a9b6600
@ -61,8 +61,10 @@ export const actions: ActionTree<State, State> = {
|
||||
const snapshot = snapshots[snapshotCursor]
|
||||
const { index, slides } = snapshot
|
||||
|
||||
const slideIndex = index > slides.length - 1 ? slides.length - 1 : index
|
||||
|
||||
commit(MutationTypes.SET_SLIDES, slides)
|
||||
commit(MutationTypes.UPDATE_SLIDE_INDEX, index)
|
||||
commit(MutationTypes.UPDATE_SLIDE_INDEX, slideIndex)
|
||||
commit(MutationTypes.SET_SNAPSHOT_CURSOR, snapshotCursor)
|
||||
commit(MutationTypes.SET_ACTIVE_ELEMENT_ID_LIST, [])
|
||||
},
|
||||
@ -75,8 +77,10 @@ export const actions: ActionTree<State, State> = {
|
||||
const snapshot = snapshots[snapshotCursor]
|
||||
const { index, slides } = snapshot
|
||||
|
||||
const slideIndex = index > slides.length - 1 ? slides.length - 1 : index
|
||||
|
||||
commit(MutationTypes.SET_SLIDES, slides)
|
||||
commit(MutationTypes.UPDATE_SLIDE_INDEX, index)
|
||||
commit(MutationTypes.UPDATE_SLIDE_INDEX, slideIndex)
|
||||
commit(MutationTypes.SET_SNAPSHOT_CURSOR, snapshotCursor)
|
||||
commit(MutationTypes.SET_ACTIVE_ELEMENT_ID_LIST, [])
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user