fix
This commit is contained in:
parent
079fa8826c
commit
61f81f44ce
14
app/page.tsx
14
app/page.tsx
|
|
@ -8,6 +8,7 @@ const Home: React.FC = () => {
|
||||||
const { login, ready, user } = usePrivy();
|
const { login, ready, user } = usePrivy();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
||||||
const setResult = async (result: string, wallet:string) => {
|
const setResult = async (result: string, wallet:string) => {
|
||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
const requestIdFromUrl = params.get('request_id');
|
const requestIdFromUrl = params.get('request_id');
|
||||||
|
|
@ -21,13 +22,14 @@ const Home: React.FC = () => {
|
||||||
result: result
|
result: result
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
console.log(`https://vps.playpoolstudios.com/metahunt/api/launcher/set_request_response.php?id=${requestIdFromUrl}&result=${result}`);
|
||||||
await axios({
|
await axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: `https://vps.playpoolstudios.com/metahunt/api/launcher/set_wallet.php`,
|
url: `https://vps.playpoolstudios.com/metahunt/api/launcher/set_wallet.php`,
|
||||||
withCredentials: false,
|
withCredentials: false,
|
||||||
params: {
|
params: {
|
||||||
id: result,
|
id: result,
|
||||||
result: wallet
|
wallet: wallet
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -36,10 +38,14 @@ const Home: React.FC = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const requestIdFromUrl = new URLSearchParams(window.location.search).get('request_id');
|
const requestIdFromUrl = new URLSearchParams(window.location.search).get('request_id');
|
||||||
if (requestIdFromUrl) {
|
|
||||||
setResult(user?.id ?? "", user?.wallet?.address ?? ""); // Replace 'some_result' with the actual result you want to send
|
if(!ready){
|
||||||
|
console.log("not ready yet");
|
||||||
}
|
}
|
||||||
}, []);
|
else if (requestIdFromUrl) {
|
||||||
|
setResult(user?.id ?? "", user?.wallet?.address ?? "no wallet"); // Replace 'some_result' with the actual result you want to send
|
||||||
|
}
|
||||||
|
}, [ready, user]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex flex-col items-center justify-center h-full'>
|
<div className='flex flex-col items-center justify-center h-full'>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user