diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/utils/state-manager/state.manager.ts b/src/Umbraco.Web.UI.Client/src/packages/core/utils/state-manager/state.manager.ts index 345012485a..1660220985 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/utils/state-manager/state.manager.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/utils/state-manager/state.manager.ts @@ -22,7 +22,9 @@ export class UmbStateManager extends UmbC */ addState(state: StateType) { if (!state.unique) throw new Error('State must have a unique property'); - // TODO: check if unique is already in the array + if (this._states.getValue().find((x) => x.unique === state.unique)) { + throw new Error('State with unique already exists'); + } this._states.setValue([...this._states.getValue(), state]); }