From 1e3f7aa721f47527288d9a180ee4b98c09ec5f63 Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Wed, 24 Jun 2026 00:54:43 +0200 Subject: [PATCH] xycyc --- modules/mining-checker/assets/js/app.js | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/modules/mining-checker/assets/js/app.js b/modules/mining-checker/assets/js/app.js index 87a73496..aff04e8f 100644 --- a/modules/mining-checker/assets/js/app.js +++ b/modules/mining-checker/assets/js/app.js @@ -1010,18 +1010,15 @@ const latestMeasurementDate = latest && latest.measured_at ? parseStoredUtcDate(latest.measured_at) : null; const latestMeasurementAgeMs = latestMeasurementDate ? (Date.now() - latestMeasurementDate.getTime()) : null; const canTransferAll = !!latestMeasurementDate - && Number.isFinite(latestMeasurementAgeMs) - && latestMeasurementAgeMs >= 0 - && latestMeasurementAgeMs <= 180000 && Number(latest?.coins_total_visible ?? latest?.coins_total ?? 0) > 0; const fullTransferCoins = Number(latest?.coins_total_visible ?? latest?.coins_total ?? 0); const transferAllHint = !latestMeasurementDate ? 'Kein Mining-Upload vorhanden.' - : latestMeasurementAgeMs < 0 - ? `Letzter Upload ${fmtDate(latest.measured_at)} liegt in der Zukunft.` - : canTransferAll - ? `Verwendet den letzten Upload von ${fmtDate(latest.measured_at)} mit ${fmtNumber(fullTransferCoins, 6)} ${currentMiningCurrency}.` - : `Alles uebertragen ist nur bis 3 Minuten nach dem letzten Upload moeglich. Letzter Upload: ${fmtDate(latest.measured_at)}.`; + : latestMeasurementAgeMs !== null && latestMeasurementAgeMs < 0 + ? `Letzter Upload ${fmtDate(latest.measured_at)} liegt in der Zukunft. Backend-Pruefung bleibt aktiv.` + : latestMeasurementAgeMs !== null && latestMeasurementAgeMs <= 180000 + ? `Verwendet den letzten Upload von ${fmtDate(latest.measured_at)} mit ${fmtNumber(fullTransferCoins, 6)} ${currentMiningCurrency}.` + : `Verwendet den letzten Upload von ${fmtDate(latest.measured_at)} mit ${fmtNumber(fullTransferCoins, 6)} ${currentMiningCurrency}. Backend erlaubt den Kompletttransfer nur, wenn dieser Upload hoechstens 3 Minuten alt ist.`; const latestWalletSnapshot = currentWalletSnapshots.length ? currentWalletSnapshots[0] : null; const currentWalletMiningBalance = walletAssetBalance(latestWalletSnapshot, currentMiningCurrency); const renewableOfferIds = new Set( @@ -2821,7 +2818,7 @@ setPayoutForm((previous) => ({ payout_at: previous.payout_at || nowDateTimeLocalValue(), coins_amount: previous.coins_amount || '', - payout_currency: currentCoinCurrency, + payout_currency: currentMiningCurrency, note: previous.note || '', })); setPayoutModalOpen(true); @@ -2861,7 +2858,7 @@ setWalletWithdrawalForm((previous) => ({ withdrawal_at: previous.withdrawal_at || nowDateTimeLocalValue(), coins_amount: previous.coins_amount || '', - withdrawal_currency: currentCoinCurrency, + withdrawal_currency: currentMiningCurrency, note: previous.note || '', })); setWalletWithdrawalModalOpen(true); @@ -3274,7 +3271,7 @@ h('div', { key: 'hint', className: 'mc-text' }, 'Hier kannst du einen Teilbetrag vom aktuellen Miner-Bestand in das NC Wallet uebertragen.'), inputField('Transferzeitpunkt', 'datetime-local', payoutForm.payout_at, (value) => setPayoutForm({ ...payoutForm, payout_at: value })), inputField('Coins', 'number', payoutForm.coins_amount, (value) => setPayoutForm({ ...payoutForm, coins_amount: value }), '0.000001'), - selectField('Waehrung', payoutForm.payout_currency, [currentCoinCurrency].concat(selectableCurrencies.map((currency) => currency.code).filter((code) => code !== currentCoinCurrency)), (value) => setPayoutForm({ ...payoutForm, payout_currency: value })), + selectField('Waehrung', payoutForm.payout_currency, [currentMiningCurrency].concat(selectableCurrencies.map((currency) => currency.code).filter((code) => code !== currentMiningCurrency)), (value) => setPayoutForm({ ...payoutForm, payout_currency: value })), textareaField('Notiz', payoutForm.note, (value) => setPayoutForm({ ...payoutForm, note: value })), h('div', { className: 'mc-inline-row' }, [ h('button', { type: 'button', className: 'mc-button mc-button--ghost', onClick: () => setPayoutModalOpen(false) }, 'Abbrechen'), @@ -3286,7 +3283,7 @@ h('form', { key: 'form', className: 'mc-form', onSubmit: submitWalletWithdrawal }, [ inputField('Auszahlungszeitpunkt', 'datetime-local', walletWithdrawalForm.withdrawal_at, (value) => setWalletWithdrawalForm({ ...walletWithdrawalForm, withdrawal_at: value })), inputField('Coins', 'number', walletWithdrawalForm.coins_amount, (value) => setWalletWithdrawalForm({ ...walletWithdrawalForm, coins_amount: value }), '0.000001'), - selectField('Waehrung', walletWithdrawalForm.withdrawal_currency, [currentCoinCurrency].concat(selectableCurrencies.map((currency) => currency.code).filter((code) => code !== currentCoinCurrency)), (value) => setWalletWithdrawalForm({ ...walletWithdrawalForm, withdrawal_currency: value })), + selectField('Waehrung', walletWithdrawalForm.withdrawal_currency, [currentMiningCurrency].concat(selectableCurrencies.map((currency) => currency.code).filter((code) => code !== currentMiningCurrency)), (value) => setWalletWithdrawalForm({ ...walletWithdrawalForm, withdrawal_currency: value })), textareaField('Notiz', walletWithdrawalForm.note, (value) => setWalletWithdrawalForm({ ...walletWithdrawalForm, note: value })), h('div', { className: 'mc-inline-row' }, [ h('button', { type: 'button', className: 'mc-button mc-button--ghost', onClick: () => setWalletWithdrawalModalOpen(false) }, 'Abbrechen'),