Skip to content

Commit

Permalink
fix: properly set ownership for private posts on entities
Browse files Browse the repository at this point in the history
Fixes #139
  • Loading branch information
Steven Weingärtner committed Aug 11, 2024
1 parent 18f7780 commit 9bbbdea
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/foundry/PageFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export default class PageFactory {
);
}

private createPostPage(name: string, content: string | null | undefined) {
private createPostPage(name: string, content: string | null | undefined, isSecret: boolean) {
if (!content) {
return null;
}
Expand All @@ -180,7 +180,7 @@ export default class PageFactory {
'post',
name,
this.entity,
undefined,
{ publicCount: isSecret ? 0 : 1 },
{ show: true, level: 2 },
{ text: { content } },
'kanka-foundry.PostPageSheet',
Expand All @@ -199,11 +199,11 @@ export default class PageFactory {

return [
...prePosts.map((note) =>
this.createPostPage(note.name, note.entry_parsed)
this.createPostPage(note.name, note.entry_parsed, isSecret(note))
),
this.createPostPage('KANKA.journal.shared.pages.entry', this.entity.entry_parsed),
this.createPostPage('KANKA.journal.shared.pages.entry', this.entity.entry_parsed, false),
...postPosts.map((note) =>
this.createPostPage(note.name, note.entry_parsed)
this.createPostPage(note.name, note.entry_parsed, isSecret(note))
),
];
}
Expand Down Expand Up @@ -370,4 +370,4 @@ export default class PageFactory {
this.getCounts(this.entity.children.map(m => ({ id: m })), 'id', this.type),
);
}
}
}

0 comments on commit 9bbbdea

Please sign in to comment.