From 476aa5372196e8a71116d301cbaa5d3d119b61e3 Mon Sep 17 00:00:00 2001 From: DreVla Date: Thu, 6 Apr 2023 18:22:57 +0300 Subject: [PATCH] Bug 1807127 - Update Sync Device name after refreshing fxa devices (cherry picked from commit c729f8e46dfddda396a08e238c5061d1639701c7) --- .../mozilla/fenix/settings/account/AccountSettingsFragment.kt | 1 + .../fenix/settings/account/AccountSettingsInteractor.kt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/mozilla/fenix/settings/account/AccountSettingsFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/account/AccountSettingsFragment.kt index 85106afcf5..05d174884a 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/account/AccountSettingsFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/account/AccountSettingsFragment.kt @@ -367,6 +367,7 @@ class AccountSettingsFragment : PreferenceFragmentCompat() { ?.deviceConstellation() ?.setDeviceName(newDeviceName, it) } + accountSettingsStore.dispatch(AccountSettingsFragmentAction.UpdateDeviceName(newDeviceName)) } return true } diff --git a/app/src/main/java/org/mozilla/fenix/settings/account/AccountSettingsInteractor.kt b/app/src/main/java/org/mozilla/fenix/settings/account/AccountSettingsInteractor.kt index 1e63c85085..71e9ca308e 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/account/AccountSettingsInteractor.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/account/AccountSettingsInteractor.kt @@ -46,7 +46,8 @@ class AccountSettingsInteractor( } // Our "change the device name on the server" operation may fail. // Currently, we disregard this failure and pretend we succeeded. - // At the same time, when user changes the device name, we immediately update the UI to display the new name. + // At the same time, when user changes the device name, + // we immediately update the UI to display the new name. // So, in case of a network (or other) failure when talking to the server, // we'll have a discrepancy - the UI will reflect new value, but actually the value never changed. // So, when user presses "sync now", we'll fetch the old value, and reset the UI.