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] =
|
||||
useState<string>("");
|
||||
|
||||
const holdRefExtState = useRef<extStates>("not-authenticated")
|
||||
useEffect(()=> {
|
||||
if(extState){
|
||||
holdRefExtState.current = extState
|
||||
}
|
||||
}, [extState])
|
||||
|
||||
const address = useMemo(() => {
|
||||
if (!rawWallet?.address0) return "";
|
||||
return rawWallet.address0;
|
||||
@ -342,6 +349,7 @@ function App() {
|
||||
// useEffect(()=> {
|
||||
// rawWalletRef.current = rawWallet
|
||||
// }, [rawWallet])
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
try {
|
||||
@ -349,6 +357,7 @@ function App() {
|
||||
chrome.runtime.sendMessage({ action: "getWalletInfo" }, (response) => {
|
||||
if (response && response?.walletInfo) {
|
||||
setRawWallet(response?.walletInfo);
|
||||
if(holdRefExtState.current === 'web-app-request-payment' || holdRefExtState.current === 'web-app-request-connection') return
|
||||
setExtstate("authenticated");
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user