Fix Android local open flow

This commit is contained in:
Joe Julian
2026-04-01 21:42:19 -07:00
parent b030b69c0d
commit 5b6f7bb1de
3 changed files with 109 additions and 8 deletions
+19 -2
View File
@@ -577,7 +577,6 @@ func newUIWithState(mode string, sess appstate.CurrentSession, paths statePaths)
apiPolicyGroupScope: true,
autofillNoticePreference: autofillNoticeAll,
backgroundResults: make(chan backgroundActionResult, 8),
requestMasterPassFocus: true,
}
u.apiPolicyAllow.Value = true
u.apiPolicyGroupScopeW.Value = true
@@ -598,10 +597,12 @@ func newUIWithState(mode string, sess appstate.CurrentSession, paths statePaths)
u.loadRecentVaults()
u.loadRecentRemotes()
u.restoreStartupLifecycleTarget()
u.requestMasterPassFocus = u.hasSelectedLifecycleTarget()
u.loadUIPreferences()
u.loadSettings()
u.loadSettingsFormFromPreferences()
u.loadSettingsDraft()
u.requestMasterPassFocus = u.hasSelectedLifecycleTarget()
u.filter()
u.syncAutofillCache()
return u
@@ -663,6 +664,10 @@ func shouldUsePreviewWindowSize(mode, goos string) bool {
return !strings.EqualFold(strings.TrimSpace(goos), "android")
}
func supportsDesktopFilePicker(goos string) bool {
return !strings.EqualFold(strings.TrimSpace(goos), "android")
}
func (u *ui) selectedAttachmentItems() []attachmentItem {
item, ok := u.selectedEntry()
if !ok || len(item.Attachments) == 0 {
@@ -1594,6 +1599,15 @@ 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()) != ""
default:
return strings.TrimSpace(u.vaultPath.Text()) != ""
}
}
func (u *ui) latestRecentVault() (string, time.Time) {
for _, path := range u.recentVaults {
if strings.TrimSpace(path) == "" {
@@ -3699,7 +3713,10 @@ func (u *ui) syncDialogContent(gtx layout.Context) layout.Dimensions {
}),
)
}
return selectorEditorHelp(u.theme, "Local Vault Path", "Choose the other local .kdbx file to synchronize with.", &u.syncLocalPath, &u.pickSyncLocalPath, "Choose File", false)(gtx)
if supportsDesktopFilePicker(runtime.GOOS) {
return selectorEditorHelp(u.theme, "Local Vault Path", "Choose the other local .kdbx file to synchronize with.", &u.syncLocalPath, &u.pickSyncLocalPath, "Choose File", false)(gtx)
}
return labeledEditorHelp(u.theme, "Local Vault Path", "Enter the shared-storage path to the other local .kdbx file to synchronize with.", &u.syncLocalPath, false)(gtx)
}),
layout.Rigid(layout.Spacer{Height: unit.Dp(14)}.Layout),
layout.Rigid(func(gtx layout.Context) layout.Dimensions {