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} }} {{'Requests.Remaining.Quota' | translate: {remaining: remaining.remaining, total: remaining.limit} }}
</h4> </h4>
<h4 class="text-center" *ngIf="daysUntil > 1"> <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>
<h4 class="text-center" *ngIf="hoursUntil > 1 && daysUntil <= 1"> <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>
<h4 class="text-center" *ngIf="minutesUntil > 1 && hoursUntil <= 1 && daysUntil <= 1" #minutes> <h4 class="text-center" *ngIf="minutesUntil >= 1 && hoursUntil <= 1 && daysUntil <= 1" #minutes>
{{minutesUntil == 1 ? 'Requests.Remaining.NextMinute' : "Requests.Remaining.NextMinutes" | translate: {time: minutesUntil} }} {{(minutesUntil == 1 ? 'Requests.Remaining.NextMinute' : 'Requests.Remaining.NextMinutes') | translate: {time: minutesUntil} }}
</h4> </h4>
</div> </div>

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

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

Loading…
Cancel
Save