ability to refresh page after the extension is installed

Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
Uncle Fatso 2026-05-11 14:34:06 +03:00
parent a2c61147f1
commit 4b84a62467
Signed by: f4ts0
GPG Key ID: 565F4F2860226EBB
2 changed files with 11 additions and 4 deletions

View File

@ -1,7 +1,7 @@
{
"name": "ghost-dao-interface",
"private": true,
"version": "0.7.47",
"version": "0.7.48",
"type": "module",
"scripts": {
"dev": "vite",

View File

@ -248,6 +248,7 @@ const WelcomeView = ({
defaultFunction,
closeModal
}) => {
const [refreshNeeded, setRefreshNeeded] = useState(false);
const [isPending, setIsPending] = useState(false);
const { epoch } = useEpoch(chainId);
@ -256,9 +257,10 @@ const WelcomeView = ({
const { isExtensionMissing } = useUnstableProvider();
const refreshPage = () => window.location.reload();
const getConnect = () => {
setRefreshNeeded(true)
window.open(GHOST_CONNECT, '_blank', 'noopener,noreferrer');
closeModal();
}
const callDefaultFunction = useCallback(async () => {
@ -308,10 +310,15 @@ const WelcomeView = ({
<PrimaryButton
disabled={isPending || gatekeeperAddress === EMPTY_ADDRESS}
onClick={isExtensionMissing ? getConnect : goNext}
onClick={isExtensionMissing
? (refreshNeeded ? refreshPage : getConnect)
: goNext
}
fullWidth
>
{isExtensionMissing ? "Get GHOST Connect" : `Start ${bridgeNumbers} ${"Stake\u00B2"}`}
{isExtensionMissing
? (refreshNeeded ? "Refresh Page" : "Get GHOST Connect")
: `Start ${bridgeNumbers} ${"Stake\u00B2"}`}
</PrimaryButton>
</>
)