mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Support setting status bar message switch https://github.com/siyuan-note/siyuan/issues/16236
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
3add5302a8
commit
d44c12be0b
1 changed files with 15 additions and 8 deletions
|
|
@ -189,13 +189,7 @@ func StatusJob() {
|
|||
}
|
||||
count[action]++
|
||||
|
||||
if action == DatabaseIndexCommit && util.StatusBarCfg.MsgTaskDatabaseIndexCommitDisabled {
|
||||
continue
|
||||
}
|
||||
if action == HistoryDatabaseIndexCommit && util.StatusBarCfg.MsgTaskHistoryDatabaseIndexCommitDisabled {
|
||||
continue
|
||||
}
|
||||
if action == AssetContentDatabaseIndexCommit && util.StatusBarCfg.MsgTaskAssetDatabaseIndexCommitDisabled {
|
||||
if skipPushTaskAction(action) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
@ -213,7 +207,7 @@ func StatusJob() {
|
|||
defer queueLock.Unlock()
|
||||
|
||||
currentTaskLock.Lock()
|
||||
if nil != currentTask && nil != actionLangs {
|
||||
if nil != currentTask && nil != actionLangs && !skipPushTaskAction(currentTask.Action) {
|
||||
if label := actionLangs[currentTask.Action]; nil != label {
|
||||
items = append([]map[string]interface{}{{"action": label.(string)}}, items...)
|
||||
}
|
||||
|
|
@ -228,6 +222,19 @@ func StatusJob() {
|
|||
util.PushBackgroundTask(data)
|
||||
}
|
||||
|
||||
func skipPushTaskAction(action string) bool {
|
||||
switch action {
|
||||
case DatabaseIndexCommit:
|
||||
return util.StatusBarCfg.MsgTaskDatabaseIndexCommitDisabled
|
||||
case HistoryDatabaseIndexCommit:
|
||||
return util.StatusBarCfg.MsgTaskHistoryDatabaseIndexCommitDisabled
|
||||
case AssetContentDatabaseIndexCommit:
|
||||
return util.StatusBarCfg.MsgTaskAssetDatabaseIndexCommitDisabled
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func ExecTaskJob() {
|
||||
task := popTask()
|
||||
if nil == task {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue