DeliveryAdminWindow: Add cooldown of one second to weighing buttons
This commit is contained in:
@ -992,6 +992,7 @@ namespace Elwig.Windows {
|
||||
|
||||
private async void WeighingButton_Click(int index) {
|
||||
DisableWeighingButtons();
|
||||
var start = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||
FinishButton.IsEnabled = false;
|
||||
NewDeliveryPartButton.IsEnabled = false;
|
||||
CancelCreatingButton.IsEnabled = false;
|
||||
@ -1007,6 +1008,9 @@ namespace Elwig.Windows {
|
||||
}
|
||||
ManualWeighingReason = null;
|
||||
ManualWeighingInput.IsChecked = false;
|
||||
var end = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||
int diff = (int)(end - start);
|
||||
if (diff < 1000 && WeightInput.Text.Length != 0) await Task.Delay(1000 - diff);
|
||||
EnableWeighingButtons();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user