committed by
József Farkas
parent
c2103c7d50
commit
715b924be0
@@ -1,7 +1,12 @@
|
||||
import { Component, ViewEncapsulation, HostListener } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { Store } from '@ngrx/store';
|
||||
|
||||
import 'rxjs/add/operator/distinctUntilChanged';
|
||||
import 'rxjs/add/operator/ignoreElements';
|
||||
import 'rxjs/add/operator/takeWhile';
|
||||
|
||||
import { AppState } from '../shared/store';
|
||||
import { getUserConfiguration } from '../shared/store/reducers/user-configuration';
|
||||
|
||||
@@ -17,7 +22,17 @@ import { UhkDeviceService } from '../services/uhk-device.service';
|
||||
})
|
||||
export class MainAppComponent {
|
||||
|
||||
constructor(private uhkDevice: UhkDeviceService, private store: Store<AppState>) { }
|
||||
constructor(private uhkDevice: UhkDeviceService, private store: Store<AppState>, router: Router) {
|
||||
uhkDevice.isConnected()
|
||||
.distinctUntilChanged()
|
||||
.takeWhile(connected => connected)
|
||||
.ignoreElements()
|
||||
.subscribe({
|
||||
complete: () => {
|
||||
router.navigate(['/detection']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.control.o', ['$event'])
|
||||
onCtrlO(event: KeyboardEvent): void {
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
import { ModuleWithProviders } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { Routes } from '@angular/router';
|
||||
|
||||
import { addOnRoutes } from '../shared/components/add-on';
|
||||
import { keymapRoutes } from '../components/keymap';
|
||||
import { macroRoutes } from '../shared/components/macro';
|
||||
import { settingsRoutes } from '../shared/components/settings';
|
||||
|
||||
const appRoutes: Routes = [
|
||||
export const mainAppRoutes: Routes = [
|
||||
...keymapRoutes,
|
||||
...macroRoutes,
|
||||
...addOnRoutes,
|
||||
...settingsRoutes
|
||||
];
|
||||
|
||||
export const appRoutingProviders: any[] = [ ];
|
||||
|
||||
export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes, { useHash: true });
|
||||
|
||||
Reference in New Issue
Block a user