fix: save history

This commit is contained in:
2026-02-05 01:14:44 +08:00
parent 3588c49d7d
commit 4b7a4eb36d
6 changed files with 51 additions and 13 deletions

13
main.go
View File

@@ -81,20 +81,25 @@ func main() {
// 窗口关闭事件
window.OnWindowEvent(events.Common.WindowClosing, func(event *application.WindowEvent) {
// 保存配置
x, y := window.Position()
width, height := window.Size()
conf.WindowState = config.WindowState{
conf.SetWindowState(config.WindowState{
X: x,
Y: y,
Width: width,
Height: height,
}
_ = conf.Save()
})
// 保存传输历史
if conf.GetSaveHistory() {
transferService.SaveHistory()
}
// 保存配置
err := conf.Save()
if err != nil {
slog.Error("Failed to save config", "error", err)
}
})
application.RegisterEvent[FilesDroppedEvent]("files-dropped")