diff --git a/frontend/app/shared/state/contents.state.ts b/frontend/app/shared/state/contents.state.ts index e41e6a4e2..51c9bf2eb 100644 --- a/frontend/app/shared/state/contents.state.ts +++ b/frontend/app/shared/state/contents.state.ts @@ -16,6 +16,7 @@ import { Pager, shareSubscribed, State, + Types, Version, Versioned } from '@app/framework'; @@ -56,15 +57,11 @@ interface Snapshot { canCreateAndPublish?: boolean; } -function sameContent(lhs: ContentDto, rhs?: ContentDto): boolean { - return lhs === rhs || (!!lhs && !!rhs && lhs.id === rhs.id && lhs.version.eq(rhs.version)); -} - export abstract class ContentsStateBase extends State { private previousId: string; public selectedContent = - this.project(x => x.selectedContent, sameContent); + this.project(x => x.selectedContent, Types.equals); public contents = this.project(x => x.contents);