File tree 1 file changed +7
-0
lines changed
packages/assets-controllers/src/MultichainAssetsRatesController
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import type {
28
28
import { HandlerType } from '@metamask/snaps-utils' ;
29
29
import { Mutex } from 'async-mutex' ;
30
30
import type { Draft } from 'immer' ;
31
+ import { isEqual } from 'lodash' ;
31
32
32
33
import { MAP_CAIP_CURRENCIES } from './constant' ;
33
34
import type {
@@ -405,6 +406,12 @@ export class MultichainAssetsRatesController extends StaticIntervalPollingContro
405
406
const allHistoricalPrices = this . state . historicalPrices ;
406
407
const cleanedHistoricalPrices =
407
408
this . #removeExpiredEntries( allHistoricalPrices ) ;
409
+
410
+ // do not update state if no changes
411
+ if ( isEqual ( allHistoricalPrices , cleanedHistoricalPrices ) ) {
412
+ return ;
413
+ }
414
+
408
415
this . update ( ( state ) => {
409
416
state . historicalPrices = cleanedHistoricalPrices ;
410
417
} ) ;
You can’t perform that action at this time.
0 commit comments