Browse Source

Content page.

pull/479/head
Sebastian 6 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,
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<Snapshot> {
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);

Loading…
Cancel
Save