Skip to content

Commit

Permalink
Await promises
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
  • Loading branch information
OlegIvaniv committed Jul 27, 2023
1 parent 0fe5600 commit ddd9b3f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/editor-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,16 @@ export default defineComponent({
// if cannot access page and is logged in
return this.$router.replace({ name: VIEWS.HOMEPAGE });
},
redirectIfNecessary() {
async redirectIfNecessary() {
const redirect =
this.$route.meta &&
typeof this.$route.meta.getRedirect === 'function' &&
this.$route.meta.getRedirect();
if (redirect) {
return this.$router.replace(redirect);
}
return;
},
setTheme() {
const theme = window.localStorage.getItem(LOCAL_STORAGE_THEME);
Expand Down Expand Up @@ -257,7 +259,7 @@ export default defineComponent({
await this.initialize();
this.logHiringBanner();
await this.authenticate();
this.redirectIfNecessary();
await this.redirectIfNecessary();
void this.checkForNewVersions();
await this.checkForCloudPlanData();
await this.initBanners();
Expand All @@ -283,7 +285,7 @@ export default defineComponent({
},
async $route(route) {
await this.initSettings();
this.redirectIfNecessary();
await this.redirectIfNecessary();
this.trackPage();
},
Expand Down

0 comments on commit ddd9b3f

Please sign in to comment.