feat: notification component

This commit is contained in:
2024-07-10 23:02:14 +03:00
parent d1e32a94ca
commit 03b200c829
9 changed files with 134 additions and 11 deletions

View File

@@ -9,13 +9,16 @@ export class RulibAuthService implements OnDestroy {
private api_url = "https://api.lib.social";
constructor(private http: HttpClient) {}
setToken(token: string) {
this.checkToken(token)
setToken(token: string): Observable<boolean> {
return this.checkToken(token)
.pipe(takeUntil(this.destroy$))
.subscribe((data) => {
if (!data) return;
localStorage.setItem("token", token);
});
.pipe(
map((data) => {
if (!data) return false;
localStorage.setItem("token", token);
return true;
}),
);
}
getToken(): string {