fix: some linting for new proto 3

This commit is contained in:
TrèsAbhi committed 2024-10-05 16:44:07 -05:00
1 parent 79bc259565
commit f14ca394b5
29 files changed
+522 -418

No files matched your search

+7 -4
View File
@@ -1,18 +1,21 @@
import {
BlitzkitResponse,
TankVotes,
unwrapBlitzkitResponse,
type BlitzkitResponse,
type TankVotes,
} from '@blitzkit/core';
import { useStore } from '@nanostores/react';
import { useEffect, useState } from 'react';
import * as App from '../stores/app';
import { $wargamingLogin } from '../stores/wargamingLogin';
const cache: Record<string, Promise<TankVotes> | TankVotes> = {};
export function useTankVotes(id: number) {
const wargaming = App.use((state) => state.logins.wargaming);
const [votes, setVotes] = useState<TankVotes | null>(null);
const wargaming = useStore($wargamingLogin);
useEffect(() => {
if (!wargaming.token) return;
if (id in cache) {
Promise.all([cache[id]]).then(([votes]) => setVotes(votes));
} else {