added type imports

This commit is contained in:
MasterGordon 2024-10-18 17:16:52 +02:00
parent 2d7e06305c
commit d26f08cd21
9 changed files with 12 additions and 11 deletions

View File

@ -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 {

View File

@ -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>(

View File

@ -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";

View File

@ -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";

View File

@ -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;

View File

@ -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";

View File

@ -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;

View File

@ -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";

View File

@ -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);
} }