feat: enhance startup logging for viewer mode detection
This commit is contained in:
15
app.go
15
app.go
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user