Skip to content

Commit 672d398

Browse files
committed
refactor(bootstrapper): strengthen multiple bootstrapper invocations
1 parent 0343ded commit 672d398

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cmd/vinegar/bootstrapper.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ func (b *bootstrapper) message(msg string, args ...any) {
7676
}
7777

7878
func (b *bootstrapper) run(args ...string) error {
79+
if b.win.GetApplication() != nil && b.win.IsVisible() {
80+
slog.Warn("Bootstrapper currently in setup, ignoring run request")
81+
return nil
82+
}
83+
7984
gtkutil.IdleAdd(func() {
8085
b.app.AddWindow(&b.win.Window)
8186
b.win.Present()

cmd/vinegar/bootstrapper_setup.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import (
1616
)
1717

1818
func (b *bootstrapper) setup() error {
19-
// Bootstrapper is currently running
20-
if b.win.GetApplication() != nil {
19+
if len(b.procs) > 0 {
2120
slog.Info("Skipping setup!", "ver", b.bin.GUID)
2221
return nil
2322
}

0 commit comments

Comments
 (0)