mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: some linting for new proto 3
This commit is contained in:
1 parent
79bc259565
commit
f14ca394b5
29 files changed
+522
-418
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user