This repository has been archived on 2024-11-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
mastodon-apps/projects/mastolists/src/app/app.component.ts
2022-12-22 16:38:25 +01:00

30 lines
1.0 KiB
TypeScript

import {Component, isDevMode} from '@angular/core';
import {select, Store} from "@ngrx/store";
import {MastodonApiActions} from "./shared/state/store/actions";
import {Observable, tap} from "rxjs";
import {selectLoadingPercentage} from "./shared/state/store/selectors";
import {PersistentStore} from "./shared/state/persistent/persistent-store.service";
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'mastolists';
navigationItems = [
{title: 'Authorize', link: '/auth'},
{title: 'Stats', link: '/sync'},
{title: 'List view', link: '/followings'},
{title: 'Matrix View', link: '/matrix'},
];
constructor(private store: Store, private persistentStore: PersistentStore) {
if (this.persistentStore.isAuthorized() && !isDevMode()) {
this.store.dispatch(MastodonApiActions.loadLists());
this.store.dispatch(MastodonApiActions.loadFollowings());
}
}
}