mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
fix: old code
This commit is contained in:
1 parent
c24639dd0c
commit
99ed269723
6 files changed
+1
-272
No files matched your search
@@ -13,7 +13,7 @@ const fonts = [
|
||||
|
||||
export default async function jsxToSvg(
|
||||
jsx: JSX.Element,
|
||||
renderConfiguration: RenderConfiguration,
|
||||
renderConfiguration = new RenderConfiguration(),
|
||||
) {
|
||||
return await satori(jsx, {
|
||||
width: renderConfiguration.width,
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
import { useSession } from '../../stores/session';
|
||||
import { setSession } from './setSession';
|
||||
|
||||
export function resetSession() {
|
||||
const session = useSession.getState();
|
||||
if (!session.isTracking) return;
|
||||
setSession(session.region, session.id, session.nickname);
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
import { Region } from '../../constants/regions';
|
||||
import { useSession } from '../../stores/session';
|
||||
import { NormalizedTankStats, TanksStats } from '../../types/tanksStats';
|
||||
import fetchBlitz from '../blitz/fetchBlitz';
|
||||
|
||||
export async function setSession(region: Region, id: number, nickname: string) {
|
||||
// TODO: generalize this function and also check for more of these kind
|
||||
const rawTankStats = (
|
||||
await fetchBlitz<TanksStats>(region, 'tanks/stats', { account_id: id })
|
||||
)[id];
|
||||
const tankStats = rawTankStats!.reduce<NormalizedTankStats>(
|
||||
(accumulator, tank) => ({
|
||||
...accumulator,
|
||||
[tank.tank_id]: tank,
|
||||
}),
|
||||
{},
|
||||
);
|
||||
|
||||
useSession.setState({
|
||||
isTracking: true,
|
||||
id,
|
||||
region,
|
||||
nickname,
|
||||
tankStats,
|
||||
time: Date.now(),
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user