Ensure unidentified access is correct when fetching own profile.

This commit is contained in:
Greyson Parrelli
2022-03-22 12:21:19 -04:00
parent 8fb598e60a
commit 9f027ed584
3 changed files with 62 additions and 12 deletions

View File

@@ -55,18 +55,6 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
private fun getConfiguration(state: InternalSettingsState): DSLConfiguration {
return configure {
sectionHeaderPref(R.string.preferences__internal_payments)
clickPref(
title = DSLSettingsText.from(R.string.preferences__internal_payment_copy_data),
summary = DSLSettingsText.from(R.string.preferences__internal_payment_copy_data_description),
onClick = {
copyPaymentsDataToClipboard()
}
)
dividerPref()
sectionHeaderPref(R.string.preferences__internal_account)
clickPref(
@@ -77,6 +65,14 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
}
)
clickPref(
title = DSLSettingsText.from(R.string.preferences__internal_refresh_profile),
summary = DSLSettingsText.from(R.string.preferences__internal_refresh_profile_description),
onClick = {
refreshProfile()
}
)
clickPref(
title = DSLSettingsText.from(R.string.preferences__internal_rotate_profile_key),
summary = DSLSettingsText.from(R.string.preferences__internal_rotate_profile_key_description),
@@ -117,6 +113,18 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
dividerPref()
sectionHeaderPref(R.string.preferences__internal_payments)
clickPref(
title = DSLSettingsText.from(R.string.preferences__internal_payment_copy_data),
summary = DSLSettingsText.from(R.string.preferences__internal_payment_copy_data_description),
onClick = {
copyPaymentsDataToClipboard()
}
)
dividerPref()
sectionHeaderPref(R.string.preferences__internal_storage_service)
switchPref(
@@ -444,6 +452,11 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
Toast.makeText(context, "Scheduled attribute refresh", Toast.LENGTH_SHORT).show()
}
private fun refreshProfile() {
ApplicationDependencies.getJobManager().add(RefreshOwnProfileJob())
Toast.makeText(context, "Scheduled profile refresh", Toast.LENGTH_SHORT).show()
}
private fun rotateProfileKey() {
ApplicationDependencies.getJobManager().add(RotateProfileKeyJob())
Toast.makeText(context, "Scheduled profile key rotation", Toast.LENGTH_SHORT).show()