Skip to content

Commit

Permalink
feat(editor): save logger and pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed Sep 30, 2021
1 parent 6e65c88 commit 0ad0e1d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 66 deletions.
3 changes: 3 additions & 0 deletions src/store/module/pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ export default {
},
} as PDFState),
mutations: {
load(state: any, payload: any) {
state.styles = payload.styles
},
setStyles(state: any, payload: any) {
state.styles = payload
},
Expand Down
66 changes: 0 additions & 66 deletions src/use/storage/indexed.ts

This file was deleted.

8 changes: 8 additions & 0 deletions src/use/storage/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export const useLocalStorage: Callback<any> = (store: Store<any>) => {
useLocalStorage().setProject({
project: store.state.project,
editor: store.state.editor,
logger: store.state.logger,
pdf: store.state.pdf,
})
}

Expand All @@ -37,6 +39,8 @@ export const useLocalStorage: Callback<any> = (store: Store<any>) => {
useLocalStorage().setProject({
project: _.state.project,
editor: _.state.editor,
logger: _.state.logger,
pdf: _.state.pdf,
})
}, parseInt(`${time}000`))
}
Expand All @@ -50,6 +54,10 @@ export const useLocalStorage: Callback<any> = (store: Store<any>) => {
await nextTick

store.commit('context/load', store.state.project.pages[0])
await nextTick

store.commit('logger/load', context.logger.content)
store.commit('pdf/load', context.pdf)
}

return {
Expand Down

0 comments on commit 0ad0e1d

Please sign in to comment.