added type imports
This commit is contained in:
parent
2d7e06305c
commit
d26f08cd21
|
|
@ -1,4 +1,4 @@
|
||||||
import { PropsWithChildren, useEffect, useRef, useState } from "react";
|
import { type PropsWithChildren, useEffect, useRef, useState } from "react";
|
||||||
import { Button } from "./components/Button";
|
import { Button } from "./components/Button";
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
import {
|
import {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { atom } from "jotai";
|
import { atom } from "jotai";
|
||||||
import { atomWithStorage } from "jotai/utils";
|
import { atomWithStorage } from "jotai/utils";
|
||||||
import { FeedItem } from "./components/Feed/FeedItem";
|
import type { FeedItem } from "./components/Feed/FeedItem";
|
||||||
|
|
||||||
export const gameIdAtom = atom<string | undefined>(undefined);
|
export const gameIdAtom = atom<string | undefined>(undefined);
|
||||||
export const loginTokenAtom = atomWithStorage<string | undefined>(
|
export const loginTokenAtom = atomWithStorage<string | undefined>(
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
import { PropsWithChildren } from "react";
|
import type { PropsWithChildren } from "react";
|
||||||
import { formatTimeSpan } from "../../../shared/time";
|
import { formatTimeSpan } from "../../../shared/time";
|
||||||
import GemsIcon from "../GemIcon";
|
import GemsIcon from "../GemIcon";
|
||||||
import { Rarity as RarityType } from "../../../shared/lootboxes";
|
import type { Rarity as RarityType } from "../../../shared/lootboxes";
|
||||||
import { Rarity } from "../Rarity";
|
import { Rarity } from "../Rarity";
|
||||||
import { themes } from "../../themes";
|
import { themes } from "../../themes";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { Link } from "wouter";
|
import { Link } from "wouter";
|
||||||
import { ServerGame } from "../../shared/game";
|
import type { ServerGame } from "../../shared/game";
|
||||||
import { formatRelativeTime, formatTimeSpan } from "../../shared/time";
|
import { formatRelativeTime, formatTimeSpan } from "../../shared/time";
|
||||||
import { Button } from "./Button";
|
import { Button } from "./Button";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
||||||
import { forwardRef, PropsWithChildren } from "react";
|
import { forwardRef, type PropsWithChildren } from "react";
|
||||||
import { cn } from "../lib/utils";
|
import { cn } from "../lib/utils";
|
||||||
|
|
||||||
const Popover = PopoverPrimitive.Root;
|
const Popover = PopoverPrimitive.Root;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { PropsWithChildren } from "react";
|
import type { PropsWithChildren } from "react";
|
||||||
import { cn } from "../lib/utils";
|
import { cn } from "../lib/utils";
|
||||||
import { rarities } from "../../shared/lootboxes";
|
import { rarities } from "../../shared/lootboxes";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import type { Application } from "pixi.js";
|
import type { Application } from "pixi.js";
|
||||||
import { IClampZoomOptions, Viewport as PixiViewport } from "pixi-viewport";
|
import {
|
||||||
|
type IClampZoomOptions,
|
||||||
|
Viewport as PixiViewport,
|
||||||
|
} from "pixi-viewport";
|
||||||
import { PixiComponent, useApp } from "@pixi/react";
|
import { PixiComponent, useApp } from "@pixi/react";
|
||||||
import { BaseTexture, SCALE_MODES } from "pixi.js";
|
import { BaseTexture, SCALE_MODES } from "pixi.js";
|
||||||
BaseTexture.defaultOptions.scaleMode = SCALE_MODES.NEAREST;
|
BaseTexture.defaultOptions.scaleMode = SCALE_MODES.NEAREST;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
import { Switch } from "../../components/Switch";
|
import { Switch } from "../../components/Switch";
|
||||||
import { useWSMutation, useWSQuery } from "../../hooks";
|
import { useWSMutation, useWSQuery } from "../../hooks";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ const createWSClient = () => {
|
||||||
let ws = new WebSocket(connectionString);
|
let ws = new WebSocket(connectionString);
|
||||||
let reconnectAttempts = 0;
|
let reconnectAttempts = 0;
|
||||||
const maxReconnectAttempts = 5;
|
const maxReconnectAttempts = 5;
|
||||||
let isAuthenticated = false;
|
|
||||||
|
|
||||||
const connect = () => {
|
const connect = () => {
|
||||||
ws = new WebSocket(connectionString);
|
ws = new WebSocket(connectionString);
|
||||||
|
|
@ -35,7 +34,6 @@ const createWSClient = () => {
|
||||||
if (token) {
|
if (token) {
|
||||||
try {
|
try {
|
||||||
await dispatch("user.loginWithToken", { token: JSON.parse(token) });
|
await dispatch("user.loginWithToken", { token: JSON.parse(token) });
|
||||||
isAuthenticated = true;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Re-authentication failed", e);
|
console.error("Re-authentication failed", e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue