ability to refresh page after the extension is installed
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
parent
a2c61147f1
commit
4b84a62467
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ghost-dao-interface",
|
"name": "ghost-dao-interface",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.7.47",
|
"version": "0.7.48",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@ -248,6 +248,7 @@ const WelcomeView = ({
|
|||||||
defaultFunction,
|
defaultFunction,
|
||||||
closeModal
|
closeModal
|
||||||
}) => {
|
}) => {
|
||||||
|
const [refreshNeeded, setRefreshNeeded] = useState(false);
|
||||||
const [isPending, setIsPending] = useState(false);
|
const [isPending, setIsPending] = useState(false);
|
||||||
|
|
||||||
const { epoch } = useEpoch(chainId);
|
const { epoch } = useEpoch(chainId);
|
||||||
@ -256,9 +257,10 @@ const WelcomeView = ({
|
|||||||
|
|
||||||
const { isExtensionMissing } = useUnstableProvider();
|
const { isExtensionMissing } = useUnstableProvider();
|
||||||
|
|
||||||
|
const refreshPage = () => window.location.reload();
|
||||||
const getConnect = () => {
|
const getConnect = () => {
|
||||||
|
setRefreshNeeded(true)
|
||||||
window.open(GHOST_CONNECT, '_blank', 'noopener,noreferrer');
|
window.open(GHOST_CONNECT, '_blank', 'noopener,noreferrer');
|
||||||
closeModal();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const callDefaultFunction = useCallback(async () => {
|
const callDefaultFunction = useCallback(async () => {
|
||||||
@ -308,10 +310,15 @@ const WelcomeView = ({
|
|||||||
|
|
||||||
<PrimaryButton
|
<PrimaryButton
|
||||||
disabled={isPending || gatekeeperAddress === EMPTY_ADDRESS}
|
disabled={isPending || gatekeeperAddress === EMPTY_ADDRESS}
|
||||||
onClick={isExtensionMissing ? getConnect : goNext}
|
onClick={isExtensionMissing
|
||||||
|
? (refreshNeeded ? refreshPage : getConnect)
|
||||||
|
: goNext
|
||||||
|
}
|
||||||
fullWidth
|
fullWidth
|
||||||
>
|
>
|
||||||
{isExtensionMissing ? "Get GHOST Connect" : `Start ${bridgeNumbers} ${"Stake\u00B2"}`}
|
{isExtensionMissing
|
||||||
|
? (refreshNeeded ? "Refresh Page" : "Get GHOST Connect")
|
||||||
|
: `Start ${bridgeNumbers} ${"Stake\u00B2"}`}
|
||||||
</PrimaryButton>
|
</PrimaryButton>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user