mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
630 B
29 lines
630 B
import { defineStore } from 'pinia'
|
|
|
|
export const useEditorStore = defineStore('editor', {
|
|
state: () => ({
|
|
isActive: false,
|
|
editor: '',
|
|
content: '',
|
|
mode: 'create',
|
|
activeModal: '',
|
|
activeModalData: null,
|
|
hideSideNav: false,
|
|
media: {
|
|
folderTree: [],
|
|
currentFolderId: 0,
|
|
currentFileId: null
|
|
},
|
|
checkoutDateActive: '',
|
|
lastSaveTimestamp: null,
|
|
lastChangeTimestamp: null,
|
|
editors: {}
|
|
}),
|
|
getters: {
|
|
hasPendingChanges: (state) => {
|
|
return state.lastSaveTimestamp && state.lastSaveTimestamp !== state.lastChangeTimestamp
|
|
}
|
|
},
|
|
actions: {}
|
|
})
|