23 lines
680 B
TypeScript
23 lines
680 B
TypeScript
import { Component } from '@angular/core';
|
|
import { StorageService } from './services/storage.service';
|
|
import { Router } from '@angular/router';
|
|
|
|
@Component({
|
|
selector: 'app-root',
|
|
templateUrl: 'app.component.html',
|
|
styleUrls: ['app.component.scss'],
|
|
standalone: false,
|
|
})
|
|
export class AppComponent {
|
|
constructor(private storageService: StorageService, private router: Router) {
|
|
this.storageService.init().then(() => {
|
|
this.storageService.getCurrentUserId().then((userId) => {
|
|
if (userId !== undefined && userId !== null) {
|
|
console.log('userId: ', userId);
|
|
this.router.navigate(['/tabs'], userId);
|
|
}
|
|
});
|
|
})
|
|
}
|
|
}
|