improve(api): event hook of after graph indexed

pull/6440/head
charlie 2022-08-22 12:17:54 +08:00 committed by Tienson Qin
parent 5815f37df1
commit 09d43983f2
2 changed files with 2 additions and 0 deletions

View File

@ -412,6 +412,7 @@ export interface IAppProxy {
// hook events
onCurrentGraphChanged: IUserHook
onGraphAfterIndexed: IUserHook<{repo: string}>
onThemeModeChanged: IUserHook<{ mode: 'dark' | 'light' }>
onThemeChanged: IUserHook<Partial<{name: string, mode: string, pid: string, url: string}>>
onBlockRendererSlotted: IUserSlotHook<{ uuid: BlockUUID }>

View File

@ -59,6 +59,7 @@
(db/set-key-value repo :ast/version db-schema/ast-version)
(search-handler/rebuild-indices!)
(db/persist! repo)
(plugin-handler/hook-plugin-app :graph-after-indexed {:repo repo :empty-graph? empty-graph?})
(when (state/setups-picker?)
(if empty-graph?
(route-handler/redirect! {:to :import :query-params {:from "picker"}})