je sais plus
This commit is contained in:
parent
ad10c23528
commit
790e9e5897
@ -129,7 +129,6 @@ const Modal = ({handleClose}: ModalProps) => {
|
||||
members: selectedOptions,
|
||||
}
|
||||
try{
|
||||
// test
|
||||
await api.post("/conv", data);
|
||||
handleClose();
|
||||
window.location.reload();
|
||||
|
||||
@ -16,6 +16,7 @@ function Field()
|
||||
useEffect(() => {
|
||||
const queryParams = queryString.parse(window.location.search);
|
||||
|
||||
console.log("launch canva hehe")
|
||||
let Modifiers = 0;
|
||||
let info: GameProps;
|
||||
|
||||
@ -37,16 +38,19 @@ function Field()
|
||||
}
|
||||
if (queryParams.username)
|
||||
{
|
||||
info = {
|
||||
privateParty: true,
|
||||
username: queryParams.username as string,
|
||||
gameId: queryParams.gameId as unknown as number
|
||||
}
|
||||
console.log("user= ", queryParams.username)
|
||||
info = {
|
||||
privateParty: true,
|
||||
username: queryParams.username as string,
|
||||
gameId: queryParams.gameId as unknown as number
|
||||
}
|
||||
console.log("info of param vefore canvas=", info)
|
||||
}
|
||||
|
||||
const cleanup = DrawCanvas(Modifiers, info);
|
||||
|
||||
return () => {
|
||||
console.log("Cleanup");
|
||||
if (cleanup)
|
||||
cleanup();
|
||||
};
|
||||
|
||||
@ -10,7 +10,6 @@ interface GameProps {
|
||||
|
||||
function DrawCanvas(option: number, gameParam: GameProps) {
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const handleBeforeUnload = async (event: { preventDefault: () => void; returnValue: string; }) => {
|
||||
try {
|
||||
@ -19,13 +18,13 @@ function DrawCanvas(option: number, gameParam: GameProps) {
|
||||
console.log(err);
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('beforeunload', handleBeforeUnload);
|
||||
return () => {
|
||||
window.removeEventListener('beforeunload', handleBeforeUnload);
|
||||
};
|
||||
}, []);
|
||||
|
||||
|
||||
console.log(`option= ${option}`);
|
||||
const superpowerModifier = option & 1; // Retrieves the superpower modifier
|
||||
const obstacleModifier = (option >> 1) & 1; // Retrieves the obstacle modifier
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { useState, useEffect } from 'react'
|
||||
import queryString from 'query-string';
|
||||
import api from "./axiosApi.tsx";
|
||||
import axios from 'axios';
|
||||
import React from 'react';
|
||||
|
||||
import {Matchlog, User} from "../../interfaces.tsx"
|
||||
import {User} from "../../interfaces.tsx"
|
||||
|
||||
function SuccessToken() {
|
||||
const location = useLocation();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user