Skip to content

Commit 4bcc0a9

Browse files
committed
Add refresh after auto logout
1 parent 185aaec commit 4bcc0a9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

methods.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,6 @@ func (a *App) startMonitor() {
225225
}
226226
logoutPercent *= 0.01
227227
if (data.Info.Overall-data.Info.Used)/data.Info.Overall < logoutPercent {
228-
err = logout.Logout()
229-
if err != nil {
230-
log.Println(err)
231-
continue
232-
}
233228
msg := "已用流量 " + strconv.FormatFloat(data.Info.Used, 'f', 2, 64) + "MB,总流量 " + strconv.FormatFloat(data.Info.Overall, 'f', 2, 64) + "MB,剩余流量不足 " + strconv.FormatFloat(remainFlux, 'f', 2, 64) + "MB,已达到注销阈值(" + data.Config.Monitor.LogoutThreshold + "%),将自动注销校园网账号!"
234229
log.Println("自动注销:" + msg)
235230
n := toast.Notification{
@@ -242,6 +237,12 @@ func (a *App) startMonitor() {
242237
log.Println(err)
243238
continue
244239
}
240+
err = logout.Logout()
241+
if err != nil {
242+
log.Println(err)
243+
continue
244+
}
245+
a.RefreshInfo()
245246
}
246247
log.Println("自动注销检测完成")
247248
}

0 commit comments

Comments
 (0)