feat: enhance startup logging for viewer mode detection

This commit is contained in:
Flavio Fois
2026-02-05 12:39:33 +01:00
parent 671f5aa8aa
commit e9b013412a

15
app.go
View File

@@ -44,7 +44,20 @@ func NewApp() *App {
// so we can call the runtime methods // so we can call the runtime methods
func (a *App) startup(ctx context.Context) { func (a *App) startup(ctx context.Context) {
a.ctx = ctx a.ctx = ctx
Log("Wails startup")
isViewer := false
for _, arg := range os.Args {
if strings.Contains(arg, "--view-image") || strings.Contains(arg, "--view-pdf") {
isViewer = true
break
}
}
if isViewer {
Log("Second instance launch")
} else {
Log("Wails startup")
}
} }
func (a *App) GetConfig() *utils.Config { func (a *App) GetConfig() *utils.Config {