possibility to self applause for frozen transactions in registry
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
parent
338cd9626a
commit
b0e7da9f86
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ghost-dao-interface",
|
"name": "ghost-dao-interface",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.3.6",
|
"version": "0.3.7",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@ -86,17 +86,6 @@ const Bridge = ({ chainId, address, config, connect }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const initialStoredTransactions = localStorage.getItem(STORAGE_PREFIX);
|
const initialStoredTransactions = localStorage.getItem(STORAGE_PREFIX);
|
||||||
// const initialStoredTransactions = JSON.stringify([
|
|
||||||
// {
|
|
||||||
// sessionIndex: 124,
|
|
||||||
// transactionHash: "0x637276eccfa0787de396877a1a259964334fb52cb5111ea84bb28f0006f06276",
|
|
||||||
// receiverAddress: "sfK147dy2NapxEKwrTLLxTkmhw15kkoJeEKrg77oLFRmUQZDb",
|
|
||||||
// amount: "10000000000000000000",
|
|
||||||
// chainId: 11155111,
|
|
||||||
// blockNumber: 9033063,
|
|
||||||
// timestamp: Date.now()
|
|
||||||
// }
|
|
||||||
// ]);
|
|
||||||
const [storedTransactions, setStoredTransactions] = useState(
|
const [storedTransactions, setStoredTransactions] = useState(
|
||||||
initialStoredTransactions ? JSON.parse(initialStoredTransactions) : []
|
initialStoredTransactions ? JSON.parse(initialStoredTransactions) : []
|
||||||
);
|
);
|
||||||
@ -248,6 +237,20 @@ const Bridge = ({ chainId, address, config, connect }) => {
|
|||||||
return storedTransactions.filter(obj => obj.chainId === chainId);
|
return storedTransactions.filter(obj => obj.chainId === chainId);
|
||||||
}, [storedTransactions, chainId]);
|
}, [storedTransactions, chainId]);
|
||||||
|
|
||||||
|
const selfApplauseUrl = useMemo(() => {
|
||||||
|
if (!currentRecord) return '';
|
||||||
|
|
||||||
|
const amount = new DecimalBigNumber(BigInt(currentRecord.amount), 18).toString();
|
||||||
|
let url = "https://lite.ghostchain.io/#/applause?";
|
||||||
|
url += `networkId=${chainId}&`;
|
||||||
|
url += `sessionIndex=${currentRecord.sessionIndex}&`;
|
||||||
|
url += `amount=${amount}&`;
|
||||||
|
url += `receiver=${currentRecord.receiverAddress}&`;
|
||||||
|
url += `transactionHash=${currentRecord.transactionHash}`;
|
||||||
|
|
||||||
|
return url;
|
||||||
|
}, [currentRecord]);
|
||||||
|
|
||||||
const removeStoredRecord = useCallback(() => {
|
const removeStoredRecord = useCallback(() => {
|
||||||
const newStoredTransactions = storedTransactions.filter((_, index) => index !== activeTxIndex)
|
const newStoredTransactions = storedTransactions.filter((_, index) => index !== activeTxIndex)
|
||||||
setStoredTransactions(newStoredTransactions);
|
setStoredTransactions(newStoredTransactions);
|
||||||
@ -472,6 +475,25 @@ const Bridge = ({ chainId, address, config, connect }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
|
{(currentRecord?.step ?? 0) < 3 && currentSession > (currentRecord?.sessionIndex ?? 0) + 2 &&
|
||||||
|
<Box display="flex" flexDirection="column" gap="5px">
|
||||||
|
<PrimaryButton
|
||||||
|
fullWidth
|
||||||
|
onClick={() => window.open(
|
||||||
|
selfApplauseUrl,
|
||||||
|
'_blank',
|
||||||
|
'noopener,noreferrer'
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
Self Applause
|
||||||
|
</PrimaryButton>
|
||||||
|
|
||||||
|
<Typography variant="body2" sx={{ fontStyle: "italic" }}>
|
||||||
|
Your transaction seems to be stuck, possibly because of a problem with some inactive validators on the network.
|
||||||
|
</Typography>
|
||||||
|
</Box>
|
||||||
|
}
|
||||||
|
|
||||||
<Box display="flex" flexDirection="column" gap="5px" padding="0.6rem 0">
|
<Box display="flex" flexDirection="column" gap="5px" padding="0.6rem 0">
|
||||||
<Box display="flex" flexDirection="row" justifyContent="space-between">
|
<Box display="flex" flexDirection="row" justifyContent="space-between">
|
||||||
<Box display="flex" flexDirection="row">
|
<Box display="flex" flexDirection="row">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user