A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang. (PERSONAL FORK)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

:recycle: Refactor push reload filetree, tag and protyle

Daniel 246efd59 ebb74238

+19 -7
+2 -2
kernel/api/ui.go
··· 29 29 ret := gulu.Ret.NewResult() 30 30 defer c.JSON(http.StatusOK, ret) 31 31 32 - util.PushReloadTag() 32 + model.ReloadTag() 33 33 } 34 34 35 35 func reloadFiletree(c *gin.Context) { 36 36 ret := gulu.Ret.NewResult() 37 37 defer c.JSON(http.StatusOK, ret) 38 38 39 - util.PushReloadFiletree() 39 + model.ReloadFiletree() 40 40 } 41 41 42 42 func reloadProtyle(c *gin.Context) {
+1 -1
kernel/model/format.go
··· 31 31 32 32 logging.LogInfof("formatting tree [%s]...", rootID) 33 33 util.PushProtyleLoading(rootID, Conf.Language(116)) 34 - defer util.PushReloadProtyle(rootID) 34 + defer ReloadProtyle(rootID) 35 35 36 36 FlushTxQueue() 37 37
+2 -2
kernel/model/history.go
··· 318 318 if writeErr := indexWriteTreeIndexQueue(tree); nil != writeErr { 319 319 return 320 320 } 321 - util.PushReloadFiletree() 322 - util.PushReloadProtyle(rootID) 321 + ReloadFiletree() 322 + ReloadProtyle(rootID) 323 323 util.PushMsg(Conf.Language(102), 3000) 324 324 325 325 IncSync()
+8
kernel/model/push_reload.go
··· 104 104 task.AppendAsyncTaskWithDelay(task.ReloadProtyle, 500*time.Millisecond, util.PushReloadDocInfo, docInfo) 105 105 } 106 106 107 + func ReloadFiletree() { 108 + task.AppendAsyncTaskWithDelay(task.ReloadFiletree, 200*time.Millisecond, util.PushReloadFiletree) 109 + } 110 + 111 + func ReloadTag() { 112 + task.AppendAsyncTaskWithDelay(task.ReloadTag, 200*time.Millisecond, util.PushReloadTag) 113 + } 114 + 107 115 func ReloadProtyle(rootID string) { 108 116 // 刷新关联的引用 109 117 defTree, _ := LoadTreeByBlockID(rootID)
+1 -1
kernel/model/repository.go
··· 1692 1692 upsertRootIDs, removeRootIDs := incReindex(upserts, removes) 1693 1693 needReloadFiletree = !needReloadUI && (needReloadFiletree || 0 < len(upsertRootIDs) || 0 < len(removeRootIDs)) 1694 1694 if needReloadFiletree { 1695 - util.PushReloadFiletree() 1695 + ReloadFiletree() 1696 1696 } 1697 1697 1698 1698 go func() {
+1 -1
kernel/model/search.go
··· 800 800 unlinks = append(unlinks, n) 801 801 } 802 802 803 - util.PushReloadTag() 803 + ReloadTag() 804 804 } else if n.IsTextMarkType("u") { 805 805 if !replaceTypes["u"] { 806 806 return ast.WalkContinue
+4
kernel/task/queue.go
··· 136 136 CacheVirtualBlockRef = "task.cache.virtualBlockRef" // 缓存虚拟块引用 137 137 ReloadAttributeView = "task.reload.attributeView" // 重新加载属性视图 138 138 ReloadProtyle = "task.reload.protyle" // 重新加载编辑器 139 + ReloadTag = "task.reload.tag" // 重新加载标签面板 140 + ReloadFiletree = "task.reload.filetree" // 重新加载文档树面板 139 141 SetRefDynamicText = "task.ref.setDynamicText" // 设置引用的动态锚文本 140 142 SetDefRefCount = "task.def.setRefCount" // 设置定义的引用计数 141 143 UpdateIDs = "task.update.ids" // 更新 ID ··· 156 158 AssetContentDatabaseIndexCommit, 157 159 ReloadAttributeView, 158 160 ReloadProtyle, 161 + ReloadTag, 162 + ReloadFiletree, 159 163 SetRefDynamicText, 160 164 SetDefRefCount, 161 165 UpdateIDs,