Commit c8aa266d authored by Mygod's avatar Mygod

Sanity check before ProfileConfig

parent 8d405c93
...@@ -78,6 +78,10 @@ class ProfileConfigFragment : PreferenceFragmentCompat(), ...@@ -78,6 +78,10 @@ class ProfileConfigFragment : PreferenceFragmentCompat(),
preferenceManager.preferenceDataStore = DataStore.privateStore preferenceManager.preferenceDataStore = DataStore.privateStore
val activity = requireActivity() val activity = requireActivity()
profileId = activity.intent.getLongExtra(Action.EXTRA_PROFILE_ID, -1L) profileId = activity.intent.getLongExtra(Action.EXTRA_PROFILE_ID, -1L)
if (profileId != -1L && profileId != DataStore.editingId) {
activity.finish()
return
}
addPreferencesFromResource(R.xml.pref_profile) addPreferencesFromResource(R.xml.pref_profile)
findPreference<EditTextPreference>(Key.remotePort)!!.setOnBindEditTextListener(EditTextPreferenceModifiers.Port) findPreference<EditTextPreference>(Key.remotePort)!!.setOnBindEditTextListener(EditTextPreferenceModifiers.Port)
findPreference<EditTextPreference>(Key.password)!!.summaryProvider = PasswordSummaryProvider findPreference<EditTextPreference>(Key.password)!!.summaryProvider = PasswordSummaryProvider
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment