feat(ui): migrate from lodash.isEqual to objectEquals

This commit is contained in:
psychedelicious
2025-06-25 18:36:17 +10:00
parent 7aefa8f36b
commit b5acc204a8
19 changed files with 76 additions and 50 deletions

View File

@@ -1,3 +1,4 @@
import { objectEquals } from '@observ33r/object-equals';
import { Mutex } from 'async-mutex';
import { deepClone } from 'common/util/deepClone';
import { withResultAsync } from 'common/util/result';
@@ -12,7 +13,6 @@ import { getKonvaNodeDebugAttrs, loadImage } from 'features/controlLayers/konva/
import type { CanvasImageState } from 'features/controlLayers/store/types';
import { t } from 'i18next';
import Konva from 'konva';
import { isEqual } from 'lodash-es';
import type { Logger } from 'roarr';
import { getImageDTOSafe } from 'services/api/endpoints/images';
@@ -198,7 +198,7 @@ export class CanvasObjectImage extends CanvasModuleBase {
const { image } = state;
const { width, height } = image;
if (force || (!isEqual(this.state, state) && !this.isLoading)) {
if (force || (!objectEquals(this.state, state) && !this.isLoading)) {
const release = await this.mutex.acquire();
try {

View File

@@ -1,3 +1,4 @@
import { objectEquals } from '@observ33r/object-equals';
import type { PayloadAction } from '@reduxjs/toolkit';
import { createSelector, createSlice } from '@reduxjs/toolkit';
import { createMemoizedSelector } from 'app/store/createMemoizedSelector';
@@ -6,7 +7,7 @@ import { getPrefixedId } from 'features/controlLayers/konva/util';
import { canvasMetadataRecalled } from 'features/controlLayers/store/canvasSlice';
import type { FLUXReduxImageInfluence, RefImagesState } from 'features/controlLayers/store/types';
import { zModelIdentifierField } from 'features/nodes/types/common';
import { clamp, isEqual } from 'lodash-es';
import { clamp } from 'lodash-es';
import type { ApiModelConfig, FLUXReduxModelConfig, ImageDTO, IPAdapterModelConfig } from 'services/api/types';
import { assert } from 'tsafe';
import type { PartialDeep } from 'type-fest';
@@ -102,7 +103,7 @@ export const refImagesSlice = createSlice({
return;
}
if (isEqual(oldModel, entity.config.model)) {
if (objectEquals(oldModel, entity.config.model)) {
// Nothing changed, so we don't need to do anything
return;
}