mirror of
https://github.com/Qortal/chrome-extension.git
synced 2025-02-11 17:55:49 +00:00
add conditions for requests
This commit is contained in:
parent
e863e19911
commit
5e5e8a2cd2
@ -81,6 +81,13 @@ function App() {
|
|||||||
const [walletToBeDownloadedError, setWalletToBeDownloadedError] =
|
const [walletToBeDownloadedError, setWalletToBeDownloadedError] =
|
||||||
useState<string>("");
|
useState<string>("");
|
||||||
|
|
||||||
|
const holdRefExtState = useRef<extStates>("not-authenticated")
|
||||||
|
useEffect(()=> {
|
||||||
|
if(extState){
|
||||||
|
holdRefExtState.current = extState
|
||||||
|
}
|
||||||
|
}, [extState])
|
||||||
|
|
||||||
const address = useMemo(() => {
|
const address = useMemo(() => {
|
||||||
if (!rawWallet?.address0) return "";
|
if (!rawWallet?.address0) return "";
|
||||||
return rawWallet.address0;
|
return rawWallet.address0;
|
||||||
@ -342,6 +349,7 @@ function App() {
|
|||||||
// useEffect(()=> {
|
// useEffect(()=> {
|
||||||
// rawWalletRef.current = rawWallet
|
// rawWalletRef.current = rawWallet
|
||||||
// }, [rawWallet])
|
// }, [rawWallet])
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
try {
|
try {
|
||||||
@ -349,6 +357,7 @@ function App() {
|
|||||||
chrome.runtime.sendMessage({ action: "getWalletInfo" }, (response) => {
|
chrome.runtime.sendMessage({ action: "getWalletInfo" }, (response) => {
|
||||||
if (response && response?.walletInfo) {
|
if (response && response?.walletInfo) {
|
||||||
setRawWallet(response?.walletInfo);
|
setRawWallet(response?.walletInfo);
|
||||||
|
if(holdRefExtState.current === 'web-app-request-payment' || holdRefExtState.current === 'web-app-request-connection') return
|
||||||
setExtstate("authenticated");
|
setExtstate("authenticated");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user