use native win32 messagebox to prevent wails dialog crash
All checks were successful
Deploy on Master Change / deploy (push) Successful in 37s

This commit is contained in:
2026-07-01 08:54:01 +07:00
parent 745e93d28d
commit 7a8c397538
3 changed files with 38 additions and 15 deletions

View File

@@ -2,6 +2,9 @@ package main
import (
"embed"
"log"
"os"
"path/filepath"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/menu"
@@ -14,7 +17,27 @@ import (
//go:embed all:frontend/dist
var assets embed.FS
func initLogging() *os.File {
configDir, err := os.UserConfigDir()
if err != nil {
return nil
}
appDir := filepath.Join(configDir, "SimpleCare")
_ = os.MkdirAll(appDir, 0755)
logFile, err := os.OpenFile(filepath.Join(appDir, "app.log"), os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
if err == nil {
log.SetOutput(logFile)
log.Println("--- Client App Started ---")
}
return logFile
}
func main() {
lf := initLogging()
if lf != nil {
defer lf.Close()
}
// Create an instance of the app structure
app := NewApp()