mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-18 13:08:06 +01:00
🎨 Prompt when there is no normal exit https://github.com/siyuan-note/siyuan/issues/11054
This commit is contained in:
parent
cac7da4eda
commit
d004b601f2
6 changed files with 32 additions and 5 deletions
|
|
@ -80,6 +80,7 @@ type AppConf struct {
|
|||
ShowChangelog bool `json:"showChangelog"` // 是否显示版本更新日志
|
||||
CloudRegion int `json:"cloudRegion"` // 云端区域,0:中国大陆,1:北美
|
||||
Snippet *conf.Snpt `json:"snippet"` // 代码片段
|
||||
State int `json:"state"` // 运行状态,0:已经正常退出,1:运行中
|
||||
|
||||
m *sync.Mutex
|
||||
}
|
||||
|
|
@ -464,6 +465,21 @@ func InitConf() {
|
|||
|
||||
Conf.LocalIPs = util.GetLocalIPs()
|
||||
|
||||
if 1 == Conf.State {
|
||||
// 上次未正常退出
|
||||
go func() {
|
||||
util.WaitForUILoaded()
|
||||
time.Sleep(2 * time.Second)
|
||||
if util.ContainerIOS == util.Container || util.ContainerAndroid == util.Container {
|
||||
util.PushMsg(Conf.language(245), 15000)
|
||||
} else {
|
||||
util.PushMsg(Conf.language(244), 15000)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
Conf.State = 1 // 运行中
|
||||
|
||||
Conf.Save()
|
||||
logging.SetLogLevel(Conf.LogLevel)
|
||||
|
||||
|
|
@ -702,6 +718,7 @@ func (conf *AppConf) save0(data []byte) {
|
|||
}
|
||||
|
||||
func (conf *AppConf) Close() {
|
||||
conf.State = 0 // 已经正常退出
|
||||
conf.Save()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue