1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-28 13:48:49 +08:00
Mainflux.mainflux/dashflux/src/app/app.component.ts
Ivan Milošević effade00aa MF-325 - Add SPDX license and copyright headers (#362)
* MF-325 - Add SPDX license and copyright headers

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* MF-325 - Add SPDX license and copyright headers

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* MF-325 - Add SPDX license and copyright headers

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* MF-325 - Add SPDX license and copyright headers

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* MF-325 - Change mainflux version from 0.4.0 to 0.5.0

Signed-off-by: Ivan Milošević <iva@blokovi.com>
2018-08-26 13:15:48 +02:00

41 lines
855 B
TypeScript

/*
* Copyright (c) 2018
* Mainflux
*
* SPDX-License-Identifier: Apache-2.0
*/
import { Component, OnInit } from '@angular/core';
import { MatSnackBar } from '@angular/material';
import { reaction } from 'mobx';
import { UiStore } from './core/store/ui.store';
import { AuthStore } from './core/store/auth.store';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
constructor(
private snackBar: MatSnackBar,
public uiStore: UiStore,
public authStore: AuthStore,
) { }
ngOnInit() {
reaction(() => this.authStore.authError, (authError) => {
if (authError) {
this.snackBar.open(authError, '', {
duration: 3000
});
}
});
}
logout() {
this.authStore.logout();
}
}