fix(chats): Fix chats leaking to other profile (#21713)

Fixes a regression introduced in PR
https://github.com/status-im/status-mobile/pull/21634.

What's important is that the fix for chats leaking to other profiles was a
client-side bug, thus not coming from status-go, thus no private data was
leaking to other profiles. This PR keeps the existing workaround to memoize
chats in the home screen.

Fixes https://github.com/status-im/status-mobile/issues/21696
This commit is contained in:
Icaro Motta 2024-12-02 23:27:37 -03:00 committed by GitHub
parent 3a444f40f3
commit d0deb94bf3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 6 deletions

View File

@ -14,8 +14,11 @@
network/status network/expensive? network/status network/expensive?
centralized-metrics/user-confirmed?] centralized-metrics/user-confirmed?]
network-type :network/network-type network-type :network/network-type
:as _db}] :as db}]
(assoc db/app-db (assoc db/app-db
;; We must carry over the current `:selected-stack-id`, otherwise the
;; app will start with `:view-id` as nil.
:shell/selected-stack-id (:shell/selected-stack-id db)
:profile/logging-out? true :profile/logging-out? true
:centralized-metrics/user-confirmed? user-confirmed? :centralized-metrics/user-confirmed? user-confirmed?
:network/type network-type :network/type network-type
@ -44,4 +47,3 @@
[:dispatch-later [:dispatch-later
{:ms 100 {:ms 100
:dispatch [:profile.logout/reset-state]}]]})) :dispatch [:profile.logout/reset-state]}]]}))

View File

@ -9,7 +9,6 @@
[native-module.core :as native-module] [native-module.core :as native-module]
[re-frame.core :as re-frame] [re-frame.core :as re-frame]
[re-frame.interop :as interop] [re-frame.interop :as interop]
[react-native.async-storage :as async-storage]
[react-native.core :as rn] [react-native.core :as rn]
[react-native.platform :as platform] [react-native.platform :as platform]
[react-native.shake :as react-native-shake] [react-native.shake :as react-native-shake]
@ -60,9 +59,6 @@
(universal-links/initialize) (universal-links/initialize)
(interceptors/register-global-interceptors) (interceptors/register-global-interceptors)
;; Shell
(async-storage/get-item :selected-stack-id #(re-frame/dispatch [:shell/change-tab %]))
(when config/quo-preview-enabled? (when config/quo-preview-enabled?
(ff/load-flags)) (ff/load-flags))

View File

@ -62,6 +62,9 @@
(rf/merge (rf/merge
cofx cofx
{:db db/app-db {:db db/app-db
:effects.async-storage/get {:keys [:selected-stack-id]
:cb (fn [{:keys [selected-stack-id]}]
(rf/dispatch [:shell/change-tab selected-stack-id]))}
:theme/init-theme nil :theme/init-theme nil
:effects.network/listen-to-network-info nil :effects.network/listen-to-network-info nil
:effects.biometric/get-supported-type nil :effects.biometric/get-supported-type nil