-
Notifications
You must be signed in to change notification settings - Fork 19
/
app.component.ts
46 lines (40 loc) · 1.27 KB
/
app.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { MenuShiftType } from '../pages/menu/shift-transition';
import { AppState } from './app.global';
import { Component, ViewChild } from '@angular/core';
import { MenuController, Nav, Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { Storage } from '@ionic/storage';
import Fingerprint2 from 'fingerprintjs2';
@Component({
templateUrl: 'app.html'
})
export class MyApp {
@ViewChild(Nav) nav: Nav;
rootPage: any = 'MenuPage';
constructor(public platform: Platform,
public statusBar: StatusBar,
public splashScreen: SplashScreen,
public global: AppState,
public storage: Storage) {
this.initializeApp();
}
initializeApp() {
this.platform.ready().then(() => {
this.storage.get('uuid').then(uuid => {
if(uuid){
this.global.set('uuid', uuid);
} else {
new Fingerprint2().get((result, components) => {
this.global.set('uuid', result);
this.storage.set('uuid', result);
});
}
});
this.global.set('side', 'light');
MenuController.registerType('shift', MenuShiftType);
this.statusBar.styleDefault();
this.splashScreen.hide();
});
}
}