Skip to content

Commit

Permalink
refactor: Initialize functions asynchronously (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonayrodriguezmrf authored Jun 19, 2024
1 parent d6cdc7c commit 5847359
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions javascripts/discourse/components/fixed-sidebar.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ export default class FixedSidebar extends Component {

constructor() {
super(...arguments);
this.fetchContents();
this.setupContents();
this.initialize();
}

async initialize() {
await this.fetchContents();
await this.setupContents();
this.router.on("routeDidChange", this, this.toggleCurrentSection);
this.toggleCurrentSection();
}
Expand Down

0 comments on commit 5847359

Please sign in to comment.