Skip to content

Commit 0ea38c5

Browse files
committed
fix: fix
1 parent 54eeb62 commit 0ea38c5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/assets-controllers/src/MultichainAssetsRatesController/MultichainAssetsRatesController.ts

+7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import type {
2828
import { HandlerType } from '@metamask/snaps-utils';
2929
import { Mutex } from 'async-mutex';
3030
import type { Draft } from 'immer';
31+
import { isEqual } from 'lodash';
3132

3233
import { MAP_CAIP_CURRENCIES } from './constant';
3334
import type {
@@ -405,6 +406,12 @@ export class MultichainAssetsRatesController extends StaticIntervalPollingContro
405406
const allHistoricalPrices = this.state.historicalPrices;
406407
const cleanedHistoricalPrices =
407408
this.#removeExpiredEntries(allHistoricalPrices);
409+
410+
// do not update state if no changes
411+
if (isEqual(allHistoricalPrices, cleanedHistoricalPrices)) {
412+
return;
413+
}
414+
408415
this.update((state) => {
409416
state.historicalPrices = cleanedHistoricalPrices;
410417
});

0 commit comments

Comments
 (0)