Persist current world history
All checks were successful
build-windows-exe / build (push) Successful in 1m50s

This commit is contained in:
messypy
2026-07-28 00:51:15 +09:00
parent 8e704980c1
commit 70bafabee9
3 changed files with 40 additions and 6 deletions

View File

@@ -43,6 +43,8 @@ const (
wmPaint = 0x000F
wmEraseBkgnd = 0x0014
wmSize = 0x0005
wmNCCalcSize = 0x0083
wmNCPaint = 0x0085
wmGetMinMaxInfo = 0x0024
wmVScroll = 0x0115
wmMouseWheel = 0x020A
@@ -589,6 +591,10 @@ func runNativeGUI(initialTab string) error {
return paintMainWindow(hwnd, &app)
case wmEraseBkgnd:
return 1
case wmNCCalcSize:
return 0
case wmNCPaint:
return 0
case wmGetMinMaxInfo:
applyMinMaxInfo(lParam)
return 0
@@ -3253,6 +3259,7 @@ type guiWorldVisitRecord struct {
type guiWorldHistoryFile struct {
UpdatedAt string `json:"updated_at"`
Visits []guiWorldVisitRecord `json:"visits"`
Current *guiWorldVisitRecord `json:"current"`
}
func readWorldHistory() []guiWorldVisitRecord {
@@ -3278,6 +3285,9 @@ func readWorldHistory() []guiWorldVisitRecord {
return nil
}
visits = snap.Visits
if snap.Current != nil && !snap.Current.StartedAt.IsZero() {
visits = append(visits, *snap.Current)
}
}
out := dedupeWorldHistory(visits)
if info, err := os.Stat(p); err == nil {