initial commit
This commit is contained in:
29
projects/mastolists/src/app/app.component.ts
Normal file
29
projects/mastolists/src/app/app.component.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user