some fixes

This commit is contained in:
kandrusyak
2022-12-05 23:09:54 +03:00
parent e0753a0779
commit 8bf83aaa5b
4 changed files with 10 additions and 4 deletions

View File

@@ -38,7 +38,7 @@ AllowedIPs = 0.0.0.0/0
Endpoint = ${servers?.[selectedServer]?.endpoint} Endpoint = ${servers?.[selectedServer]?.endpoint}
PersistentKeepalive = 25 PersistentKeepalive = 25
`, `,
[store.vpnServers, store.vpnPrivateKey, selectedServer] [servers, store.vpnPrivateKey, selectedServer]
); );
useEffect(() => { useEffect(() => {

View File

@@ -198,7 +198,10 @@ const TransactionPanel = observer(
<button <button
className="btn bg-indigo-500 hover:bg-indigo-600 text-white w-full" className="btn bg-indigo-500 hover:bg-indigo-600 text-white w-full"
onClick={() => { onClick={() => {
postTransaction(delegate.address, BigInt(amount)); postTransaction(
delegate.address,
BigInt(delegate.status === 'Vote' ? amount : amount * -1)
);
onClose(); onClose();
}} }}
> >

View File

@@ -45,7 +45,7 @@ const TransactionsTable = observer(({ data, rowClick }) => {
balance={delegate.token.balance} balance={delegate.token.balance}
name={delegate.dpos.delegate.username || delegate.address} name={delegate.dpos.delegate.username || delegate.address}
total={delegate.dpos.delegate.totalVotesReceived} total={delegate.dpos.delegate.totalVotesReceived}
hasSevice hasSevice={false}
date={delegate.date} date={delegate.date}
status={delegate.status} status={delegate.status}
amount={store.accountSentVotes[delegate.address] || 0} amount={store.accountSentVotes[delegate.address] || 0}

View File

@@ -564,7 +564,10 @@ class Store {
(obj, vote) => ({ (obj, vote) => ({
...obj, ...obj,
[vote.delegateAddress]: [vote.delegateAddress]:
BigInt(vote.amount) / 100000000n + BigInt(
Number(vote.amount) > 0 ? vote.amount : vote.amount.slice(1)
) /
100000000n +
(obj[vote.delegateAddress] || 0n), (obj[vote.delegateAddress] || 0n),
}), }),
{} {}