xycyc
This commit is contained in:
@@ -1010,18 +1010,15 @@
|
|||||||
const latestMeasurementDate = latest && latest.measured_at ? parseStoredUtcDate(latest.measured_at) : null;
|
const latestMeasurementDate = latest && latest.measured_at ? parseStoredUtcDate(latest.measured_at) : null;
|
||||||
const latestMeasurementAgeMs = latestMeasurementDate ? (Date.now() - latestMeasurementDate.getTime()) : null;
|
const latestMeasurementAgeMs = latestMeasurementDate ? (Date.now() - latestMeasurementDate.getTime()) : null;
|
||||||
const canTransferAll = !!latestMeasurementDate
|
const canTransferAll = !!latestMeasurementDate
|
||||||
&& Number.isFinite(latestMeasurementAgeMs)
|
|
||||||
&& latestMeasurementAgeMs >= 0
|
|
||||||
&& latestMeasurementAgeMs <= 180000
|
|
||||||
&& Number(latest?.coins_total_visible ?? latest?.coins_total ?? 0) > 0;
|
&& Number(latest?.coins_total_visible ?? latest?.coins_total ?? 0) > 0;
|
||||||
const fullTransferCoins = Number(latest?.coins_total_visible ?? latest?.coins_total ?? 0);
|
const fullTransferCoins = Number(latest?.coins_total_visible ?? latest?.coins_total ?? 0);
|
||||||
const transferAllHint = !latestMeasurementDate
|
const transferAllHint = !latestMeasurementDate
|
||||||
? 'Kein Mining-Upload vorhanden.'
|
? 'Kein Mining-Upload vorhanden.'
|
||||||
: latestMeasurementAgeMs < 0
|
: latestMeasurementAgeMs !== null && latestMeasurementAgeMs < 0
|
||||||
? `Letzter Upload ${fmtDate(latest.measured_at)} liegt in der Zukunft.`
|
? `Letzter Upload ${fmtDate(latest.measured_at)} liegt in der Zukunft. Backend-Pruefung bleibt aktiv.`
|
||||||
: canTransferAll
|
: 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}.`
|
||||||
: `Alles uebertragen ist nur bis 3 Minuten nach dem letzten Upload moeglich. Letzter Upload: ${fmtDate(latest.measured_at)}.`;
|
: `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 latestWalletSnapshot = currentWalletSnapshots.length ? currentWalletSnapshots[0] : null;
|
||||||
const currentWalletMiningBalance = walletAssetBalance(latestWalletSnapshot, currentMiningCurrency);
|
const currentWalletMiningBalance = walletAssetBalance(latestWalletSnapshot, currentMiningCurrency);
|
||||||
const renewableOfferIds = new Set(
|
const renewableOfferIds = new Set(
|
||||||
@@ -2821,7 +2818,7 @@
|
|||||||
setPayoutForm((previous) => ({
|
setPayoutForm((previous) => ({
|
||||||
payout_at: previous.payout_at || nowDateTimeLocalValue(),
|
payout_at: previous.payout_at || nowDateTimeLocalValue(),
|
||||||
coins_amount: previous.coins_amount || '',
|
coins_amount: previous.coins_amount || '',
|
||||||
payout_currency: currentCoinCurrency,
|
payout_currency: currentMiningCurrency,
|
||||||
note: previous.note || '',
|
note: previous.note || '',
|
||||||
}));
|
}));
|
||||||
setPayoutModalOpen(true);
|
setPayoutModalOpen(true);
|
||||||
@@ -2861,7 +2858,7 @@
|
|||||||
setWalletWithdrawalForm((previous) => ({
|
setWalletWithdrawalForm((previous) => ({
|
||||||
withdrawal_at: previous.withdrawal_at || nowDateTimeLocalValue(),
|
withdrawal_at: previous.withdrawal_at || nowDateTimeLocalValue(),
|
||||||
coins_amount: previous.coins_amount || '',
|
coins_amount: previous.coins_amount || '',
|
||||||
withdrawal_currency: currentCoinCurrency,
|
withdrawal_currency: currentMiningCurrency,
|
||||||
note: previous.note || '',
|
note: previous.note || '',
|
||||||
}));
|
}));
|
||||||
setWalletWithdrawalModalOpen(true);
|
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.'),
|
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('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'),
|
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 })),
|
textareaField('Notiz', payoutForm.note, (value) => setPayoutForm({ ...payoutForm, note: value })),
|
||||||
h('div', { className: 'mc-inline-row' }, [
|
h('div', { className: 'mc-inline-row' }, [
|
||||||
h('button', { type: 'button', className: 'mc-button mc-button--ghost', onClick: () => setPayoutModalOpen(false) }, 'Abbrechen'),
|
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 }, [
|
h('form', { key: 'form', className: 'mc-form', onSubmit: submitWalletWithdrawal }, [
|
||||||
inputField('Auszahlungszeitpunkt', 'datetime-local', walletWithdrawalForm.withdrawal_at, (value) => setWalletWithdrawalForm({ ...walletWithdrawalForm, withdrawal_at: value })),
|
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'),
|
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 })),
|
textareaField('Notiz', walletWithdrawalForm.note, (value) => setWalletWithdrawalForm({ ...walletWithdrawalForm, note: value })),
|
||||||
h('div', { className: 'mc-inline-row' }, [
|
h('div', { className: 'mc-inline-row' }, [
|
||||||
h('button', { type: 'button', className: 'mc-button mc-button--ghost', onClick: () => setWalletWithdrawalModalOpen(false) }, 'Abbrechen'),
|
h('button', { type: 'button', className: 'mc-button mc-button--ghost', onClick: () => setWalletWithdrawalModalOpen(false) }, 'Abbrechen'),
|
||||||
|
|||||||
Reference in New Issue
Block a user