Skip to content

Commit

Permalink
Make fancy_body a computed property
Browse files Browse the repository at this point in the history
  • Loading branch information
lynn committed Nov 19, 2023
1 parent 6968668 commit 28af79f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion frontend/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ export default defineComponent({
process_entry(e: Entry): Entry {
if (e.uncollapsed === undefined) e.uncollapsed = false;
e.fancy_body = shared.replacements(e.body, false, false);
e.notes.forEach(
_ => (_.fancy_content = shared.replacements(_.content, false, false)),
);
Expand Down
7 changes: 6 additions & 1 deletion frontend/Result.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ defineProps<{
}}</span>
</span>
</div>
<p class="body" v-html="result.fancy_body"></p>
<p class="body" v-html="fancy_body"></p>
<div class="notes">
<p class="note" v-for="note in result.notes">
<span
Expand Down Expand Up @@ -184,5 +184,10 @@ export default defineComponent({
input: '',
};
},
computed: {
fancy_body() {
return shared.replacements(this.result.body, false, false);
},
},
});
</script>
1 change: 0 additions & 1 deletion frontend/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export interface Entry {
notes: Note[];
score: number;

fancy_body?: string;
uncollapsed?: boolean;
vote?: number;
}
Expand Down

0 comments on commit 28af79f

Please sign in to comment.