mirror of
https://github.com/NicolasConstant/sengi
synced 2025-02-03 11:57:41 +01:00
added waiting icon
This commit is contained in:
parent
c5d3f6c97b
commit
2b9adece64
@ -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>
|
@ -1,3 +1,4 @@
|
||||
@import "commons";
|
||||
@import "mixins";
|
||||
|
||||
$avatar-size: 40px;
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user