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-row align-items-center>
<ion-col>Hi, there! Select or create a page to get started.</ion-col> <ion-col>Hi, there! Select or create a page to get started.</ion-col>
</ion-row> </ion-row>

View File

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