Browse Source

Content page.

pull/479/head
Sebastian 7 years ago
parent
commit
3181e49e41
  1. 7
      frontend/app/shared/state/contents.state.ts

7
frontend/app/shared/state/contents.state.ts

@ -16,6 +16,7 @@ import {
Pager, Pager,
shareSubscribed, shareSubscribed,
State, State,
Types,
Version, Version,
Versioned Versioned
} from '@app/framework'; } from '@app/framework';
@ -56,15 +57,11 @@ interface Snapshot {
canCreateAndPublish?: boolean; 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<Snapshot> { export abstract class ContentsStateBase extends State<Snapshot> {
private previousId: string; private previousId: string;
public selectedContent = public selectedContent =
this.project(x => x.selectedContent, sameContent); this.project(x => x.selectedContent, Types.equals);
public contents = public contents =
this.project(x => x.contents); this.project(x => x.contents);

Loading…
Cancel
Save