From 0a32b73d8d00cc82f302380d98b2dd29f292cb5f Mon Sep 17 00:00:00 2001 From: PARAIPAN SORIN <51127880+PARAIPAN9@users.noreply.github.com> Date: Mon, 25 Nov 2024 21:37:53 +0200 Subject: [PATCH] Refactor FXIOS-10693 - Optimize `showMenuWarningBadge` Toolbar Action dispatch (#23373) --- .../Views/BrowserViewController.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift b/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift index 2f294efb36b3..128e6530c718 100644 --- a/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift +++ b/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift @@ -391,6 +391,13 @@ class BrowserViewController: UIViewController, let showWarningBadge = isActionNeeded if isToolbarRefactorEnabled { + let shouldShowWarningBadge = store.state.screenState( + ToolbarState.self, + for: .toolbar, + window: windowUUID + )?.showMenuWarningBadge + + guard showWarningBadge != shouldShowWarningBadge else { return } let action = ToolbarAction( showMenuWarningBadge: showWarningBadge, windowUUID: windowUUID,