fix homepage style and disable direct access to the editor page

Brokenbuttons
garrettmills 4 years ago
parent 3444dd2774
commit b3be216de9

@ -1,4 +1,4 @@
<ion-grid style="height: 100%; justify-content: center;">
<ion-grid style="height: 100%; justify-content: center; display: flex; font-size: 24pt; color: #ccc;">
<ion-row align-items-center>
<ion-col>Hi, there! Select or create a page to get started.</ion-col>
</ion-row>

@ -2,7 +2,7 @@ import {Component, Host, OnInit, ViewChild, ViewChildren} from '@angular/core';
import HostRecord from '../../structures/HostRecord';
import PageRecord from '../../structures/PageRecord';
import {PageService} from '../../service/page.service';
import {ActivatedRoute} from '@angular/router';
import {ActivatedRoute, Router} from '@angular/router';
@Component({
selector: 'app-editor',
@ -20,15 +20,14 @@ export class EditorPage implements OnInit {
constructor(
protected pages: PageService,
protected route: ActivatedRoute,
protected router: Router,
) {
this.route.params.subscribe(params => {
this.pageId = params.id;
});
}
ngOnInit() {
console.log('Editor component: ', this);
}
ngOnInit() {}
ionViewDidEnter() {
if ( this.pageId ) {
@ -38,6 +37,8 @@ export class EditorPage implements OnInit {
this.hostRecords = hosts;
});
});
} else {
this.router.navigate(['/home']);
}
}

Loading…
Cancel
Save