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