mirror of
https://github.com/mainflux/mainflux.git
synced 2025-04-28 13:48:49 +08:00

* 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>
41 lines
855 B
TypeScript
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();
|
|
}
|
|
}
|