mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 localStorage 支持在多界面实例间同步 https://github.com/siyuan-note/siyuan/issues/6965
This commit is contained in:
parent
3adb7d9ad0
commit
95bb18afe1
12 changed files with 49 additions and 55 deletions
|
|
@ -121,7 +121,7 @@ func ClosePushChan(id string) {
|
|||
}
|
||||
|
||||
func ReloadUI() {
|
||||
evt := NewCmdResult("reloadui", 0, PushModeBroadcast, 0)
|
||||
evt := NewCmdResult("reloadui", 0, PushModeBroadcast)
|
||||
PushEvent(evt)
|
||||
}
|
||||
|
||||
|
|
@ -208,7 +208,7 @@ func PushClearProgress() {
|
|||
}
|
||||
|
||||
func PushDownloadProgress(id string, percent float32) {
|
||||
evt := NewCmdResult("downloadProgress", 0, PushModeBroadcast, 0)
|
||||
evt := NewCmdResult("downloadProgress", 0, PushModeBroadcast)
|
||||
evt.Data = map[string]interface{}{
|
||||
"id": id,
|
||||
"percent": percent,
|
||||
|
|
@ -219,9 +219,6 @@ func PushDownloadProgress(id string, percent float32) {
|
|||
func PushEvent(event *Result) {
|
||||
msg := event.Bytes()
|
||||
mode := event.PushMode
|
||||
if "reload" == event.Cmd {
|
||||
mode = event.ReloadPushMode
|
||||
}
|
||||
switch mode {
|
||||
case PushModeBroadcast:
|
||||
Broadcast(msg)
|
||||
|
|
@ -235,7 +232,6 @@ func PushEvent(event *Result) {
|
|||
broadcastApp(msg, event.AppId)
|
||||
case PushModeBroadcastMainExcludeSelfApp:
|
||||
broadcastOtherAppMains(msg, event.AppId)
|
||||
case PushModeNone:
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue