Fix Android local open flow
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user