diff --git a/src/app/modules/beteran/component/home.component.ts b/src/app/modules/beteran/component/home.component.ts index 7c45a52..1a97a56 100644 --- a/src/app/modules/beteran/component/home.component.ts +++ b/src/app/modules/beteran/component/home.component.ts @@ -6,6 +6,7 @@ import { ViewEncapsulation, } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; +import { Router } from '@angular/router'; import { CompComposeComponent } from 'app/modules/beteran/compose/compose/comp-compose.component'; import { CustomerComposeComponent } from 'app/modules/beteran/compose/compose/customer-compose.component'; @@ -209,6 +210,7 @@ export class HomeComponent implements OnInit { */ constructor( private _changeDetectorRef: ChangeDetectorRef, + private _router: Router, private _matDialog: MatDialog, private _vendorService: VendorService ) {} @@ -290,6 +292,9 @@ export class HomeComponent implements OnInit { const dialogRef = this._matDialog.open(selectType); dialogRef.afterClosed().subscribe((result) => { + if (ComposeMenuType.signIn === composeMenuType && !!result.choice) { + this._router.navigate(['game']); + } console.log('Compose dialog was closed!'); }); } diff --git a/src/app/modules/beteran/compose/compose/deposit-compose.component.ts b/src/app/modules/beteran/compose/compose/deposit-compose.component.ts index 89fd62b..3ee29bc 100644 --- a/src/app/modules/beteran/compose/compose/deposit-compose.component.ts +++ b/src/app/modules/beteran/compose/compose/deposit-compose.component.ts @@ -99,7 +99,12 @@ export class DepositComposeComponent implements OnInit { this.composeForm?.enable(); // Reset the form - }); + }) + .finally(() => + setTimeout(() => { + this.matDialogRef.close(); + }, 2000) + ); // req.set } diff --git a/src/app/modules/beteran/compose/compose/sign-in-compose.component.ts b/src/app/modules/beteran/compose/compose/sign-in-compose.component.ts index 501fc35..e7cf560 100644 --- a/src/app/modules/beteran/compose/compose/sign-in-compose.component.ts +++ b/src/app/modules/beteran/compose/compose/sign-in-compose.component.ts @@ -5,6 +5,11 @@ import { fuseAnimations } from '@fuse/animations'; import { FuseAlertType } from '@fuse/components/alert'; import { AuthService } from 'app/core/auth/auth.service'; +export interface SignInComposeData {} +export interface SignInComposeResult { + choice: boolean; +} + @Component({ selector: 'sign-in-compose', templateUrl: './sign-in-compose.component.html', @@ -86,8 +91,8 @@ export class SignInComposeComponent implements OnInit { this._authService .signIn(this.signInComposeForm?.value) .then(() => { - console.log(); this.showAlert = true; + this.matDialogRef.close({ choice: true }); }) .catch((e) => { this.showAlert = true;