Simplify desktop remote open flow
This commit is contained in:
@@ -1752,12 +1752,16 @@ func (u *ui) restoreStartupLifecycleTarget() {
|
||||
func (u *ui) hasSelectedLifecycleTarget() bool {
|
||||
switch strings.TrimSpace(u.lifecycleMode) {
|
||||
case "remote":
|
||||
return strings.TrimSpace(u.remoteBaseURL.Text()) != "" && strings.TrimSpace(u.remotePath.Text()) != ""
|
||||
return u.hasSelectedRemoteTarget()
|
||||
default:
|
||||
return strings.TrimSpace(u.vaultPath.Text()) != ""
|
||||
}
|
||||
}
|
||||
|
||||
func (u *ui) hasSelectedRemoteTarget() bool {
|
||||
return strings.TrimSpace(u.remoteBaseURL.Text()) != "" && strings.TrimSpace(u.remotePath.Text()) != ""
|
||||
}
|
||||
|
||||
func (u *ui) latestRecentVault() (string, time.Time) {
|
||||
for _, path := range u.recentVaults {
|
||||
if strings.TrimSpace(path) == "" {
|
||||
@@ -1776,6 +1780,10 @@ func (u *ui) showLocalVaultChooser() bool {
|
||||
return u.lifecycleMode != "local" || !u.hasSelectedVaultPath()
|
||||
}
|
||||
|
||||
func (u *ui) showRemoteConnectionChooser() bool {
|
||||
return u.lifecycleMode != "remote" || !u.hasSelectedRemoteTarget()
|
||||
}
|
||||
|
||||
func (u *ui) switchToLifecycleSelection(mode string) {
|
||||
u.state.Session = &session.Manager{}
|
||||
u.state.CurrentPath = nil
|
||||
|
||||
Reference in New Issue
Block a user