fix homepage style and disable direct access to the editor page

This commit is contained in:
garrettmills 2020-02-08 15:44:39 -06:00
parent 3444dd2774
commit b3be216de9
2 changed files with 6 additions and 5 deletions

View File

@ -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>

View File

@ -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']);
}
}