diff --git a/projects/plugins/protect/changelog/fix-protect-stats-property-naming b/projects/plugins/protect/changelog/fix-protect-stats-property-naming new file mode 100644 index 0000000000000..7988ecde8d81b --- /dev/null +++ b/projects/plugins/protect/changelog/fix-protect-stats-property-naming @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Fixes blockedRequests destructuring fallback diff --git a/projects/plugins/protect/src/js/components/firewall-header/index.jsx b/projects/plugins/protect/src/js/components/firewall-header/index.jsx index b543072733dfb..09ee0eb92074a 100644 --- a/projects/plugins/protect/src/js/components/firewall-header/index.jsx +++ b/projects/plugins/protect/src/js/components/firewall-header/index.jsx @@ -130,9 +130,8 @@ const ConnectedFirewallHeader = () => { const { hasPlan } = usePlan(); const isSupportedWafFeatureEnabled = wafSupported ? isEnabled : bruteForceProtection; const currentStatus = isSupportedWafFeatureEnabled ? 'on' : 'off'; - const { currentDay: currentDayBlockCount, thirtyDays: thirtyDayBlockCounts } = stats - ? stats.blockedRequests - : { currentDayStats: 0, thirtyDaysStats: 0 }; + const { currentDay: currentDayBlockCount = 0, thirtyDays: thirtyDaysBlockCounts = 0 } = + stats?.blockedRequests || {}; return ( { bruteForceProtectionIsEnabled={ bruteForceProtection } wafSupported={ wafSupported } currentDayStats={ currentDayBlockCount } - thirtyDaysStats={ thirtyDayBlockCounts } + thirtyDaysStats={ thirtyDaysBlockCounts } standaloneMode={ standaloneMode } /> );