From 92f1aab25da12411aa256c3b763e0cb6182e9320 Mon Sep 17 00:00:00 2001 From: Aditya Wasan Date: Thu, 15 Oct 2020 20:46:39 +0530 Subject: Add option to automatically sync repository on app launch (#1137) * Add option to automatically sync repository on app launch Signed-off-by: Aditya Wasan * Pull repo if user is not authenticated Signed-off-by: Aditya Wasan * Address review comments Signed-off-by: Harsh Shandilya * Hijack incoming intent rather than copying it Signed-off-by: Harsh Shandilya * Initialize password repository before using it Signed-off-by: Aditya Wasan Co-authored-by: Harsh Shandilya --- app/src/main/java/com/zeapo/pwdstore/UserPreference.kt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/src/main/java/com/zeapo/pwdstore/UserPreference.kt') diff --git a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt index 7f6727f2..6edd9ceb 100644 --- a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt +++ b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt @@ -46,6 +46,7 @@ import com.zeapo.pwdstore.autofill.AutofillPreferenceActivity import com.zeapo.pwdstore.crypto.BasePgpActivity import com.zeapo.pwdstore.git.GitConfigActivity import com.zeapo.pwdstore.git.GitServerConfigActivity +import com.zeapo.pwdstore.git.config.GitSettings import com.zeapo.pwdstore.git.sshj.SshKey import com.zeapo.pwdstore.pwgenxkpwd.XkpwdDictionary import com.zeapo.pwdstore.sshkeygen.ShowSshKeyFragment @@ -424,6 +425,8 @@ class UserPreference : AppCompatActivity() { true } + findPreference(PreferenceKeys.SYNC_ON_LAUNCH)?.isVisible = !GitSettings.url.isNullOrEmpty() + val prefCustomXkpwdDictionary = findPreference(PreferenceKeys.PREF_KEY_CUSTOM_DICT) prefCustomXkpwdDictionary?.onPreferenceClickListener = ClickListener { prefsActivity.storeCustomDictionaryPath() -- cgit v1.2.3