Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pptist
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
pptist
Commits
22931897
Commit
22931897
authored
Dec 28, 2023
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复 编辑撤回 数据清除问题
parent
942f280d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
snapshot.ts
src/store/snapshot.ts
+6
-2
database.ts
src/utils/database.ts
+2
-1
No files found.
src/store/snapshot.ts
View file @
22931897
...
...
@@ -39,6 +39,7 @@ export const useSnapshotStore = defineStore('snapshot', {
const
newFirstSnapshot
=
{
index
:
slidesStore
.
slideIndex
,
slides
:
slidesStore
.
slides
,
thumbnails
:
slidesStore
.
thumbnails
}
await
db
.
snapshots
.
add
(
newFirstSnapshot
)
this
.
setSnapshotCursor
(
0
)
...
...
@@ -64,6 +65,7 @@ export const useSnapshotStore = defineStore('snapshot', {
const
snapshot
=
{
index
:
slidesStore
.
slideIndex
,
slides
:
slidesStore
.
slides
,
thumbnails
:
slidesStore
.
thumbnails
}
await
db
.
snapshots
.
add
(
snapshot
)
...
...
@@ -98,11 +100,12 @@ export const useSnapshotStore = defineStore('snapshot', {
const
snapshotCursor
=
this
.
snapshotCursor
-
1
const
snapshots
:
Snapshot
[]
=
await
db
.
snapshots
.
orderBy
(
'id'
).
toArray
()
const
snapshot
=
snapshots
[
snapshotCursor
]
const
{
index
,
slides
}
=
snapshot
const
{
index
,
slides
,
thumbnails
}
=
snapshot
const
slideIndex
=
index
>
slides
.
length
-
1
?
slides
.
length
-
1
:
index
slidesStore
.
setSlides
(
slides
)
slidesStore
.
setThumbnails
(
thumbnails
)
slidesStore
.
updateSlideIndex
(
slideIndex
)
this
.
setSnapshotCursor
(
snapshotCursor
)
mainStore
.
setActiveElementIdList
([])
...
...
@@ -117,12 +120,13 @@ export const useSnapshotStore = defineStore('snapshot', {
const
snapshotCursor
=
this
.
snapshotCursor
+
1
const
snapshots
:
Snapshot
[]
=
await
db
.
snapshots
.
orderBy
(
'id'
).
toArray
()
const
snapshot
=
snapshots
[
snapshotCursor
]
const
{
index
,
slides
}
=
snapshot
const
{
index
,
slides
,
thumbnails
}
=
snapshot
const
slideIndex
=
index
>
slides
.
length
-
1
?
slides
.
length
-
1
:
index
slidesStore
.
setSlides
(
slides
)
slidesStore
.
updateSlideIndex
(
slideIndex
)
slidesStore
.
setThumbnails
(
thumbnails
)
this
.
setSnapshotCursor
(
snapshotCursor
)
mainStore
.
setActiveElementIdList
([])
},
...
...
src/utils/database.ts
View file @
22931897
...
...
@@ -10,7 +10,8 @@ export interface writingBoardImg {
export
interface
Snapshot
{
index
:
number
slides
:
Slide
[]
slides
:
Slide
[],
thumbnails
:
string
[]
}
const
databaseNamePrefix
=
'PPTist'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment