Skip to content

Commit 9e51673

Browse files
authored
Merge pull request #628 from rsksmart/fix-labeling-GBI-2456
fix: error labeling | GBI-2456
2 parents 24d71ba + ba61a36 commit 9e51673

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/adapters/entrypoints/rest/assets/static/management.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,17 @@ function getConfirmationConfig(sectionId) {
258258
if (!tempArray[idx]) tempArray[idx] = {};
259259

260260
if (input.value.trim() === '') {
261-
showErrorToast(`Please enter a non-empty value for "${input.dataset.field === 'amount' ? 'rBTC amount' : 'confirmations'}."`);
261+
const amountLabel = configKey === 'btcConfirmations' ? 'BTC amount' : 'rBTC amount';
262+
showErrorToast(`Please enter a non-empty value for "${input.dataset.field === 'amount' ? amountLabel : 'confirmations'}."`);
262263
throw new Error(`Empty ${input.dataset.field} input`);
263264
}
264265

265266
if (input.dataset.field === 'amount') {
266267
try {
267268
tempArray[idx].amount = etherToWei(input.value).toString();
268269
} catch (error) {
269-
showErrorToast(`Invalid input "${input.value}" for rBTC amount. Please enter a valid non-negative number.`);
270+
const amountLabel = configKey === 'btcConfirmations' ? 'BTC amount' : 'rBTC amount';
271+
showErrorToast(`Invalid input "${input.value}" for ${amountLabel}. Please enter a valid non-negative number.`);
270272
throw error;
271273
}
272274
} else if (input.dataset.field === 'confirmation') {

0 commit comments

Comments
 (0)