Spaces:
Paused
Paused
Update flare-ui/src/app/app.component.ts
Browse files
flare-ui/src/app/app.component.ts
CHANGED
|
@@ -52,12 +52,7 @@ export class AppComponent implements OnInit {
|
|
| 52 |
constructor(private router: Router) {}
|
| 53 |
|
| 54 |
ngOnInit() {
|
| 55 |
-
//
|
| 56 |
-
setTimeout(() => {
|
| 57 |
-
this.loading = false;
|
| 58 |
-
}, 100);
|
| 59 |
-
|
| 60 |
-
// Router events
|
| 61 |
this.router.events.subscribe(event => {
|
| 62 |
if (event instanceof NavigationStart) {
|
| 63 |
this.loading = true;
|
|
@@ -66,9 +61,15 @@ export class AppComponent implements OnInit {
|
|
| 66 |
event instanceof NavigationCancel ||
|
| 67 |
event instanceof NavigationError
|
| 68 |
) {
|
| 69 |
-
//
|
| 70 |
setTimeout(() => {
|
| 71 |
this.loading = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
}, 300);
|
| 73 |
}
|
| 74 |
});
|
|
|
|
| 52 |
constructor(private router: Router) {}
|
| 53 |
|
| 54 |
ngOnInit() {
|
| 55 |
+
// Router events - spinner'ı navigation event'lere göre yönet
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
this.router.events.subscribe(event => {
|
| 57 |
if (event instanceof NavigationStart) {
|
| 58 |
this.loading = true;
|
|
|
|
| 61 |
event instanceof NavigationCancel ||
|
| 62 |
event instanceof NavigationError
|
| 63 |
) {
|
| 64 |
+
// Navigation tamamlandığında spinner'ı kapat
|
| 65 |
setTimeout(() => {
|
| 66 |
this.loading = false;
|
| 67 |
+
|
| 68 |
+
// Initial loader'ı kaldır (varsa)
|
| 69 |
+
const initialLoader = document.querySelector('.initial-loader');
|
| 70 |
+
if (initialLoader) {
|
| 71 |
+
initialLoader.remove();
|
| 72 |
+
}
|
| 73 |
}, 300);
|
| 74 |
}
|
| 75 |
});
|