Skip to content

Commit

Permalink
Simply new UI component in portmaster-start
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Jul 22, 2024
1 parent 666b8b6 commit 8b4f84c
Showing 1 changed file with 8 additions and 26 deletions.
34 changes: 8 additions & 26 deletions cmds/portmaster-start/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,27 +109,8 @@ func init() {
PIDFile: true,
RestartOnFail: true,
},
app2Options,
})

if onWindows {
registerComponent([]Options{
{
Name: "Portmaster App2",
Identifier: "app2/portmaster-app.zip",
AllowDownload: false,
AllowHidingWindow: false,
},
})
} else {
registerComponent([]Options{
{
Name: "Portmaster App2",
Identifier: "app2/portmaster-app",
AllowDownload: false,
AllowHidingWindow: false,
},
})
}
}

func registerComponent(opts []Options) {
Expand Down Expand Up @@ -352,12 +333,13 @@ func persistOutputStreams(opts *Options, version string, cmd *exec.Cmd) (chan st
}

func execute(opts *Options, args []string) (cont bool, err error) {
if !forceOldUI && registry.UsePreReleases && opts.ShortIdentifier == "app" {
// Check if new ui was already tried.
if !fallBackToOldUI {
opts = &app2Options
log.Println("Using new UI")
}
// Auto-upgrade to new UI if in beta and new UI is not disabled or failed.
if opts.ShortIdentifier == "app" &&
registry.UsePreReleases &&
!forceOldUI &&
!fallBackToOldUI {
log.Println("auto-upgraded to new UI")
opts = &app2Options
}

file, err := registry.GetFile(
Expand Down

0 comments on commit 8b4f84c

Please sign in to comment.