@ -59,6 +59,12 @@ class AccountSettingsFragment : PreferenceFragmentCompat(), CoroutineScope {
override fun onLoggedOut() {
launch {
Navigation.findNavController(view!!).popBackStack()
// Remove the device name when we log out.
context?.let {
val deviceNameKey = it.getPreferenceKey(R.string.pref_key_sync_device_name)
preferenceManager.sharedPreferences.edit().remove(deviceNameKey).apply()
}