Refactor code

pull/2467/head
Kenton Royal 6 years ago
parent c12cb10972
commit 967109f4b2

@ -3,13 +3,13 @@
{{'Requests.Remaining.Quota' | translate: {remaining: remaining.remaining, total: remaining.limit} }}
</h4>
<h4 class="text-center" *ngIf="daysUntil > 1">
{{daysUntil == 1 ? 'Requests.Remaining.NextDay' : "Requests.Remaining.NextDays" | translate: {time: daysUntil} }}
{{'Requests.Remaining.NextDays' | translate: {time: daysUntil} }}
</h4>
<h4 class="text-center" *ngIf="hoursUntil > 1 && daysUntil <= 1">
{{hoursUntil == 1 ? 'Requests.Remaining.NextHour' : "Requests.Remaining.NextHours" | translate: {time: hoursUntil} }}
{{'Requests.Remaining.NextHours' | translate: {time: hoursUntil} }}
</h4>
<h4 class="text-center" *ngIf="minutesUntil > 1 && hoursUntil <= 1 && daysUntil <= 1" #minutes>
{{minutesUntil == 1 ? 'Requests.Remaining.NextMinute' : "Requests.Remaining.NextMinutes" | translate: {time: minutesUntil} }}
<h4 class="text-center" *ngIf="minutesUntil >= 1 && hoursUntil <= 1 && daysUntil <= 1" #minutes>
{{(minutesUntil == 1 ? 'Requests.Remaining.NextMinute' : 'Requests.Remaining.NextMinutes') | translate: {time: minutesUntil} }}
</h4>
</div>

@ -27,10 +27,6 @@ export class RemainingRequestsComponent implements OnInit {
this.update();
});
setInterval(() => {
self.calculateTime();
}, 10000);
setInterval(() => {
self.update();
}, 60000);

@ -149,9 +149,7 @@
"Remaining": {
"Quota": "{{remaining}}/{{total}} requests remaining",
"NextDays": "Another request will be added in {{time}} days",
"NextDay": "Another request will be added in {{time}} day",
"NextHours": "Another request will be added in {{time} hours",
"NextHour": "Another request will be added in {{time} hour",
"NextHours": "Another request will be added in {{time}} hours",
"NextMinutes": "Another request will be added in {{time}} minutes",
"NextMinute": "Another request will be added in {{time}} minute"
}

Loading…
Cancel
Save