feat: adds links to import / export settings page

This commit is contained in:
2022-12-28 08:27:32 +01:00
parent 5620bf2c93
commit fb57344b1b
2 changed files with 15 additions and 1 deletions

View File

@@ -37,6 +37,17 @@
</button>
</div>
<div class="divider"></div>
<div style="display:flex; flex-direction: column;">
<a [href]="'https://' + instanceName + '/settings/export'" rel="noreferrer" target="_blank">
Export lists using your account settings page
</a>
<a [href]="'https://' + instanceName + '/settings/import'" rel="noreferrer" target="_blank">
Import lists using your account settings page
</a>
</div>
<div *ngIf="(lists$ | async) && (followings$ | async)">
<p>Now you can:</p>
<ul>

View File

@@ -4,6 +4,7 @@ import {MastodonApiActions} from "../../shared/state/store/actions";
import {selectFollowings, selectLists, selectListsWithAccounts, selectLoading} from "../../shared/state/store/selectors";
import {Observable, tap} from "rxjs";
import {Account, List} from 'projects/mastodon-api/src/public-api';
import {PersistentStore} from "../../shared/state/persistent/persistent-store.service";
@Component({
selector: 'app-sync',
@@ -14,8 +15,10 @@ export class SyncComponent {
loading$: Observable<boolean>;
followings$: Observable<ReadonlyArray<Account>>;
lists$: Observable<ReadonlyArray<List>>;
instanceName: string;
constructor(private store: Store) {
constructor(private store: Store, private persistentStore: PersistentStore) {
this.instanceName = persistentStore.value.currentInstance.instanceName;
this.followings$ = this.store.pipe(select(selectFollowings))
this.lists$ = this.store.pipe(select(selectListsWithAccounts));
this.loading$ = this.store.pipe(select(selectLoading));