mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
upd: keep marked flag on move file
This commit is contained in:
@@ -4,7 +4,7 @@ import store from '@fe/support/store'
|
||||
import * as storage from '@fe/utils/storage'
|
||||
import { basename } from '@fe/utils/path'
|
||||
import type { BuildInSettings, Doc, Repo } from '@fe/types'
|
||||
import { showHelp, switchDoc, unmarkDoc } from '@fe/services/document'
|
||||
import { isMarked, markDoc, showHelp, switchDoc, unmarkDoc } from '@fe/services/document'
|
||||
import { refreshTree } from '@fe/services/tree'
|
||||
import { getSelectionInfo, whenEditorReady } from '@fe/services/editor'
|
||||
import { getLanguage, setLanguage } from '@fe/services/i18n'
|
||||
@@ -73,6 +73,14 @@ registerHook('DOC_SWITCH_FAILED', (payload?: { doc?: Doc | null, message: string
|
||||
}
|
||||
})
|
||||
|
||||
registerHook('DOC_MOVED', async ({ oldDoc, newDoc }) => {
|
||||
if (isMarked(oldDoc)) {
|
||||
await unmarkDoc(oldDoc)
|
||||
await markDoc(newDoc)
|
||||
await refreshTree()
|
||||
}
|
||||
})
|
||||
|
||||
registerHook('SETTING_FETCHED', () => {
|
||||
if (!getPurchased(true)) {
|
||||
whenEditorReady().then(() => {
|
||||
|
||||
Reference in New Issue
Block a user