Label sole saved remote as sync path
This commit is contained in:
@@ -2269,6 +2269,20 @@ func (u *ui) savedRemoteBindingSummary() (profileLabel, credentialLabel string,
|
||||
return profile.Name, credentialLabel, true
|
||||
}
|
||||
|
||||
func (u *ui) savedRemoteBindingHeading() string {
|
||||
if !u.shouldShowSavedRemoteBindingSelectors() {
|
||||
return "Use this vault's saved remote sync target"
|
||||
}
|
||||
return "Use a saved remote profile from this vault"
|
||||
}
|
||||
|
||||
func (u *ui) openSelectedVaultRemoteButtonLabel() string {
|
||||
if !u.shouldShowSavedRemoteBindingSelectors() {
|
||||
return "Use Remote Sync"
|
||||
}
|
||||
return "Open Saved Remote"
|
||||
}
|
||||
|
||||
func remoteBindingSuffix(baseURL, path, username string) string {
|
||||
sum := sha256.Sum256([]byte(strings.TrimSpace(baseURL) + "\n" + strings.TrimSpace(path) + "\n" + strings.TrimSpace(username)))
|
||||
return hex.EncodeToString(sum[:8])
|
||||
@@ -4934,7 +4948,7 @@ func (u *ui) syncMenu(gtx layout.Context) layout.Dimensions {
|
||||
rows = append(rows,
|
||||
layout.Rigid(layout.Spacer{Height: unit.Dp(10)}.Layout),
|
||||
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
||||
lbl := material.Label(u.theme, unit.Sp(11), "Use a saved remote profile from this vault")
|
||||
lbl := material.Label(u.theme, unit.Sp(11), u.savedRemoteBindingHeading())
|
||||
lbl.Color = mutedColor
|
||||
return lbl.Layout(gtx)
|
||||
}),
|
||||
@@ -5014,7 +5028,7 @@ func (u *ui) syncMenu(gtx layout.Context) layout.Dimensions {
|
||||
rows = append(rows,
|
||||
layout.Rigid(layout.Spacer{Height: unit.Dp(6)}.Layout),
|
||||
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
||||
return tonedButton(gtx, u.theme, &u.openSelectedVaultRemote, "Open Saved Remote")
|
||||
return tonedButton(gtx, u.theme, &u.openSelectedVaultRemote, u.openSelectedVaultRemoteButtonLabel())
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user