Shift remote open copy to local-first flow
This commit is contained in:
@@ -2602,13 +2602,36 @@ func (u *ui) remoteOpenRetryAvailable() bool {
|
||||
return u.lifecycleMode == "remote" && strings.HasPrefix(strings.TrimSpace(u.state.ErrorMessage), "open remote vault failed:")
|
||||
}
|
||||
|
||||
func (u *ui) selectedRemoteUsesLocalCache() bool {
|
||||
return u.hasSelectedRemoteTarget() &&
|
||||
strings.TrimSpace(u.vaultPath.Text()) != "" &&
|
||||
strings.TrimSpace(u.selectedVaultRemoteProfileID) != "" &&
|
||||
strings.TrimSpace(u.selectedVaultRemoteCredentialEntryID) != ""
|
||||
}
|
||||
|
||||
func (u *ui) remoteLifecycleMessage() string {
|
||||
if u.selectedRemoteUsesLocalCache() {
|
||||
return "Open the local cache for this remote vault, then unlock and sync it with the vault-stored remote settings."
|
||||
}
|
||||
return "Connect to a remote vault, then unlock it with the KeePass master key."
|
||||
}
|
||||
|
||||
func (u *ui) remoteOpenButtonLabel() string {
|
||||
switch {
|
||||
case u.lifecycleBusy():
|
||||
if u.selectedRemoteUsesLocalCache() {
|
||||
return "Opening Cached Vault..."
|
||||
}
|
||||
return "Opening Remote Vault..."
|
||||
case u.remoteOpenRetryAvailable():
|
||||
if u.selectedRemoteUsesLocalCache() {
|
||||
return "Retry Cached Vault"
|
||||
}
|
||||
return "Retry Remote Vault"
|
||||
default:
|
||||
if u.selectedRemoteUsesLocalCache() {
|
||||
return "Open Cached Vault"
|
||||
}
|
||||
return "Open Remote Vault"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user