web/satellite: fix promise usages

Change-Id: I6496ebdd57667e8222b2bfbe6174860997b6bb3f
This commit is contained in:
Egon Elbre 2021-09-08 12:23:50 +03:00
parent 6e660cecdd
commit 09e1ff7fc4
3 changed files with 10 additions and 4 deletions

View File

@ -31,7 +31,11 @@ export default class App extends Vue {
*/
public mounted(): void {
const satelliteName = MetaUtils.getMetaContent('satellite-name');
const partneredSatellitesJson = JSON.parse(MetaUtils.getMetaContent('partnered-satellites'));
const partneredSatellitesData = MetaUtils.getMetaContent('partnered-satellites');
let partneredSatellitesJson = [];
if(partneredSatellitesData) {
partneredSatellitesJson = JSON.parse(partneredSatellitesData);
}
const isBetaSatellite = MetaUtils.getMetaContent('is-beta-satellite');
const couponCodeBillingUIEnabled = MetaUtils.getMetaContent('coupon-code-billing-ui-enabled');
const couponCodeSignupUIEnabled = MetaUtils.getMetaContent('coupon-code-signup-ui-enabled');

View File

@ -50,8 +50,9 @@ export default class NavigationArea extends Vue {
* Lifecycle hook before initial render.
* Sets navigation side bar list.
*/
public async beforeMount(): Promise<void> {
if (await JSON.parse(MetaUtils.getMetaContent('file-browser-flow-disabled'))) {
public beforeMount(): void {
const value = MetaUtils.getMetaContent('file-browser-flow-disabled');
if (value === "true") {
this.navigation = [
RouteConfig.ProjectDashboard.withIcon(DashboardIcon),
RouteConfig.AccessGrants.withIcon(AccessGrantsIcon),

View File

@ -22,7 +22,8 @@ export default class ObjectsArea extends Vue {
* Redirects if flow is disabled.
*/
public async mounted(): Promise<void> {
if (await JSON.parse(MetaUtils.getMetaContent('file-browser-flow-disabled'))) {
const value = MetaUtils.getMetaContent('file-browser-flow-disabled');
if (value === "true") {
await this.$router.push(RouteConfig.ProjectDashboard.path);
}
}