Skip to content

Commit f755032

Browse files
authored
DEV: Replace deprecated firstObject with array indexing in docs-topic.gjs (#222)
Update the `docs-topic.gjs` file to replace the deprecated `firstObject` method with standard array indexing. This change enhances code compatibility with newer Ember versions and maintains functionality by directly accessing the first element of the `posts` array.
1 parent 5e4a1d8 commit f755032

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

assets/javascripts/discourse/components/docs-topic.gjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default class DocsTopic extends Component {
2828
model() {
2929
const post = this.store.createRecord(
3030
"post",
31-
this.topic.post_stream?.posts.firstObject
31+
this.topic.post_stream?.posts[0]
3232
);
3333

3434
if (!post.topic) {

0 commit comments

Comments
 (0)