Skip to content

Commit

Permalink
display paragraphs in proper order (#1923)
Browse files Browse the repository at this point in the history
* display paragraphs in proper order

* fix
  • Loading branch information
ebrehault authored Jan 22, 2025
1 parent f89146b commit 789dc28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@

@for (paragraph of filteredParagraphs | async; track paragraph.paragraphId + paragraph.key) {
<div class="paragraph-container">
{{ paragraph.start }}
@if (paragraph.url) {
<p>
<img
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export class PreviewComponent implements OnInit, OnDestroy {
this.editResourceService.currentFieldData,
]).pipe(
map(([paragraphs, fieldType, fieldData]) => {
paragraphs = paragraphs.sort((a, b) => (a.start || 0) - (b.start || 0));
if (fieldType.field_type !== FIELD_TYPE.file) {
return paragraphs;
} else {
Expand Down

0 comments on commit 789dc28

Please sign in to comment.