This is a type script file im trying to implement auth guard from an observable from another service but this annoying error keeps popping up
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree, } from '@angular/router';
import { ToastrService } from 'ngx-toastr';
import { map, Observable } from 'rxjs';
import { AccountsService } from 'src/Services/Accounts.service';
@Injectable({
providedIn: 'root'
})
export class AuthGuard implements CanActivate {
constructor(private accountsService: AccountsService, private toastr: ToastrService, private router: Router) {}
canActivate(): Observable<boolean> {
return this.accountsService.currentUser$.pipe(
map((user) =>{
if(user) return true;
})
)
}
}