1
0
mirror of https://github.com/NicolasConstant/sengi synced 2025-02-03 03:47:35 +01:00

added waiting icon

This commit is contained in:
Nicolas Constant 2019-09-07 14:56:00 -04:00
parent c5d3f6c97b
commit 2b9adece64
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
3 changed files with 16 additions and 0 deletions

View File

@ -43,5 +43,7 @@
(click)="confirmReschedule()" title="confirm rescheduling">REPLAN</button>
</div>
<app-waiting-animation class="waiting-icon" *ngIf="isLoading"></app-waiting-animation>
</div>
</div>

View File

@ -1,3 +1,4 @@
@import "commons";
@import "mixins";
$avatar-size: 40px;

View File

@ -16,6 +16,7 @@ import { StatusSchedulerComponent } from '../../../../components/create-status/s
export class ScheduledStatusComponent implements OnInit {
deleting: boolean = false;
rescheduling: boolean = false;
isLoading: boolean = false;
@ViewChild(StatusSchedulerComponent) statusScheduler: StatusSchedulerComponent;
@ -47,6 +48,9 @@ export class ScheduledStatusComponent implements OnInit {
}
confirmDeletion(): boolean {
if(this.isLoading) return false;
this.isLoading = true;
this.mastodonService.deleteScheduledStatus(this.account, this.status.id)
.then(() => {
this.scheduledStatusService.removeStatus(this.account, this.status.id);
@ -54,6 +58,9 @@ export class ScheduledStatusComponent implements OnInit {
.catch(err => {
this.notificationService.notifyHttpError(err);
})
.then(() => {
this.isLoading = false;
});
return false;
}
@ -68,6 +75,9 @@ export class ScheduledStatusComponent implements OnInit {
}
confirmReschedule(): boolean {
if(this.isLoading) return false;
this.isLoading = true;
let scheduledTime = this.statusScheduler.getScheduledDate();
this.mastodonService.changeScheduledStatus(this.account, this.status.id, scheduledTime)
.then(() => {
@ -76,6 +86,9 @@ export class ScheduledStatusComponent implements OnInit {
})
.catch(err => {
this.notificationService.notifyHttpError(err);
})
.then(() => {
this.isLoading = false;
});
return false;
}