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}
PersistentKeepalive = 25
`,
[store.vpnServers, store.vpnPrivateKey, selectedServer]
[servers, store.vpnPrivateKey, selectedServer]
);
useEffect(() => {

View File

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

View File

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

View File

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