added remove TL-list logic
This commit is contained in:
parent
51ef48150f
commit
5bff9a12e2
|
@ -1,7 +1,7 @@
|
||||||
<div class="my-account__body flexcroll">
|
<div class="my-account__body flexcroll">
|
||||||
<h4 class="my-account__label">add timeline:</h4>
|
<h4 class="my-account__label">add timeline:</h4>
|
||||||
<div class="my-account__link--margin-bottom" *ngFor="let stream of availableStreams">
|
<div class="my-account__link--margin-bottom" *ngFor="let stream of availableStreams">
|
||||||
<a href *ngIf="stream.isAdded" class="my-account__list--button" title="remove timeline">
|
<a href *ngIf="stream.isAdded" class="my-account__list--button" title="remove timeline" (click)="removeStream(stream)">
|
||||||
<fa-icon class="my-account__link--icon my-account__link--remove" [icon]="faTimes"></fa-icon>
|
<fa-icon class="my-account__link--icon my-account__link--remove" [icon]="faTimes"></fa-icon>
|
||||||
</a>
|
</a>
|
||||||
<a href class="my-account__link my-account__link--margin-bottom my-account__blue" (click)="addStream(stream)"
|
<a href class="my-account__link my-account__link--margin-bottom my-account__blue" (click)="addStream(stream)"
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
*ngIf="list.confirmDeletion">
|
*ngIf="list.confirmDeletion">
|
||||||
<fa-icon class="my-account__link--icon" [icon]="faCheck"></fa-icon>
|
<fa-icon class="my-account__link--icon" [icon]="faCheck"></fa-icon>
|
||||||
</a>
|
</a>
|
||||||
<a href *ngIf="list.isAdded" class="my-account__list--button" title="remove list">
|
<a href *ngIf="list.isAdded" class="my-account__list--button" title="remove list" (click)="removeStream(list)">
|
||||||
<fa-icon class="my-account__link--icon my-account__list--remove" [icon]="faTimes"></fa-icon>
|
<fa-icon class="my-account__link--icon my-account__list--remove" [icon]="faTimes"></fa-icon>
|
||||||
</a>
|
</a>
|
||||||
<a class="my-account__link my-account__list my-account__blue" href (click)="addStream(list)"
|
<a class="my-account__link my-account__list my-account__blue" href (click)="addStream(list)"
|
||||||
|
|
|
@ -137,6 +137,16 @@ export class MyAccountComponent implements OnInit, OnDestroy {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
removeStream(stream: StreamWrapper): boolean {
|
||||||
|
if (stream && stream.isAdded) {
|
||||||
|
this.store.dispatch([new RemoveStream(stream.id)]).toPromise()
|
||||||
|
.then(() => {
|
||||||
|
stream.isAdded = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
removeAccount(): boolean {
|
removeAccount(): boolean {
|
||||||
const accountId = this.account.info.id;
|
const accountId = this.account.info.id;
|
||||||
this.store.dispatch([new RemoveAllStreams(accountId), new RemoveAccount(accountId)]);
|
this.store.dispatch([new RemoveAllStreams(accountId), new RemoveAccount(accountId)]);
|
||||||
|
|
Loading…
Reference in New Issue