2019-11-19 07:44:50 +00:00
|
|
|
import { Injectable, Inject } from '@angular/core';
|
|
|
|
import { UCAP_NATIVE_SERVICE, NativeService } from '@ucap-webmessenger/native';
|
|
|
|
import { Store } from '@ngrx/store';
|
|
|
|
import { NGXLogger } from 'ngx-logger';
|
|
|
|
|
|
|
|
import * as AuthenticationStore from '@app/store/account/authentication';
|
2019-11-21 01:29:19 +00:00
|
|
|
import * as SettingsStore from '@app/store/messenger/settings';
|
2019-11-19 07:44:50 +00:00
|
|
|
|
|
|
|
@Injectable({
|
|
|
|
providedIn: 'root'
|
|
|
|
})
|
|
|
|
export class AppNativeService {
|
|
|
|
constructor(
|
|
|
|
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService,
|
|
|
|
private store: Store<any>,
|
|
|
|
private logger: NGXLogger
|
|
|
|
) {}
|
|
|
|
|
|
|
|
subscribe(): void {
|
|
|
|
this.nativeService.logout().subscribe(() => {
|
2019-11-25 01:47:44 +00:00
|
|
|
this.store.dispatch(AuthenticationStore.logoutConfirmation());
|
2019-11-19 07:44:50 +00:00
|
|
|
});
|
|
|
|
this.nativeService.changeStatus().subscribe(statusCode => {});
|
2019-11-21 01:29:19 +00:00
|
|
|
this.nativeService.showSetting().subscribe(() => {
|
|
|
|
this.store.dispatch(SettingsStore.showDialog());
|
|
|
|
});
|
2019-11-19 07:44:50 +00:00
|
|
|
}
|
|
|
|
}
|