mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +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]++
|
count[action]++
|
||||||
|
|
||||||
if action == DatabaseIndexCommit && util.StatusBarCfg.MsgTaskDatabaseIndexCommitDisabled {
|
if skipPushTaskAction(action) {
|
||||||
continue
|
|
||||||
}
|
|
||||||
if action == HistoryDatabaseIndexCommit && util.StatusBarCfg.MsgTaskHistoryDatabaseIndexCommitDisabled {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if action == AssetContentDatabaseIndexCommit && util.StatusBarCfg.MsgTaskAssetDatabaseIndexCommitDisabled {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -213,7 +207,7 @@ func StatusJob() {
|
||||||
defer queueLock.Unlock()
|
defer queueLock.Unlock()
|
||||||
|
|
||||||
currentTaskLock.Lock()
|
currentTaskLock.Lock()
|
||||||
if nil != currentTask && nil != actionLangs {
|
if nil != currentTask && nil != actionLangs && !skipPushTaskAction(currentTask.Action) {
|
||||||
if label := actionLangs[currentTask.Action]; nil != label {
|
if label := actionLangs[currentTask.Action]; nil != label {
|
||||||
items = append([]map[string]interface{}{{"action": label.(string)}}, items...)
|
items = append([]map[string]interface{}{{"action": label.(string)}}, items...)
|
||||||
}
|
}
|
||||||
|
|
@ -228,6 +222,19 @@ func StatusJob() {
|
||||||
util.PushBackgroundTask(data)
|
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() {
|
func ExecTaskJob() {
|
||||||
task := popTask()
|
task := popTask()
|
||||||
if nil == task {
|
if nil == task {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue