fixed auctions and opened them

This commit is contained in:
Arseniy Sitnikov 2024-12-13 12:17:17 +03:00
parent 6ae11e83d6
commit 0cb8a5c7a9
8 changed files with 21 additions and 20 deletions

BIN
frontend/src/.DS_Store vendored

Binary file not shown.

Binary file not shown.

View File

@ -35,7 +35,7 @@ export function Timer({initTime}: ITimer) {
return (
<div className={styles.container}>
<div className={styles.block}>
<p className={styles.value} style={ETextStyles.InSb14120}>{hour}</p>
<p className={styles.value} style={ETextStyles.InSb14120}>{hour.toString().length === 1 ? `0${hour}` : hour}</p>
<p className={styles.text} style={ETextStyles.RwRg12120}>{declension(hour, 'час', 'часа', 'часов')}</p>
</div>
<div className={styles.dot}></div>

View File

@ -1,17 +1,12 @@
import React, { useEffect, useState } from 'react';
import React, { useState } from 'react';
import styles from './clickerfooter.module.css';
import { ClickerBtnFooter } from '../ClickerBtnFooter';
import { EIcons, Icon } from '../../Icons';
import { useNavigate } from 'react-router-dom';
import { isWhiteList } from '../../../utils/isWhiteList';
export function ClickerFooter() {
const navigate = useNavigate();
const [isDev, setIsDev] = useState(true);
useEffect(() => {
setIsDev(!isWhiteList());
}, []);
const [isDev, setIsDev] = useState(false);
return (
<div className={styles.container}>

View File

@ -42,9 +42,8 @@ export function ClickerPage({ name, points, img, energy }: IClickerPageInterface
const html = document.querySelector('html');
if(html) {
html.style.overflow = 'scroll';
html.style.overflowY = 'scroll';
}
}, []);
useEffect(() => {

View File

@ -88,6 +88,7 @@ export const auctionRequestAsync = (): ThunkAction<void, RootState, unknown, Act
const loseAuctions = [];
for (let i = 0; i < data.length; i++) {
const active = Boolean(data[i].is_active);
const nowDate = new Date();
const endDate = new Date(data[i].end_time);
const time = Math.ceil(Math.abs(endDate.getTime() - nowDate.getTime()) / 1000);
@ -112,7 +113,9 @@ export const auctionRequestAsync = (): ThunkAction<void, RootState, unknown, Act
bet: dataBet[k].value
}
topAuctions.push(topItem);
if(active) {
topAuctions.push(topItem);
}
}
}
}
@ -131,7 +134,9 @@ export const auctionRequestAsync = (): ThunkAction<void, RootState, unknown, Act
bet: userData[z].value
}
loseAuctions.push(loseItem)
if(active) {
loseAuctions.push(loseItem)
}
}
}
}
@ -151,7 +156,9 @@ export const auctionRequestAsync = (): ThunkAction<void, RootState, unknown, Act
myBet: myBet.toString()
};
auctionResults.push(item);
if(active) {
auctionResults.push(item);
}
}
dispatch(updateMyAuctions(topAuctions, 'top'));

View File

@ -112,6 +112,8 @@ export const meRequestAsync = (): ThunkAction<void, RootState, unknown, Action<s
},
).then((resp) => {
const user = resp.data;
sessionStorage.setItem('shT', 't');
sessionStorage.setItem('shL', 't');
axios.get(`${URLClick}/api/v1/energy`, {
headers: {
//"Content-type": "application/json",
@ -125,8 +127,6 @@ export const meRequestAsync = (): ThunkAction<void, RootState, unknown, Action<s
const savedToken = sessionStorage.getItem('tk');
if (savedToken) {
if (savedToken != encodeToken) {
sessionStorage.setItem('shT', 't');
sessionStorage.setItem('shL', 't');
sessionStorage.setItem('tk', encodeToken);
firstClick(token);
const energyCode = btoa(energy.toString());
@ -162,6 +162,7 @@ export const meRequestAsync = (): ThunkAction<void, RootState, unknown, Action<s
maxStorage: Number(user.max_storage)
};
dispatch(meRequestSuccess(userData));
loadNewRank();
}).catch((err) => {
console.log(err);
if (err.response.data.detail) {
@ -203,6 +204,8 @@ export const meRequestAsync = (): ThunkAction<void, RootState, unknown, Action<s
}
},
).then((resp) => {
sessionStorage.setItem('shT', 't');
sessionStorage.setItem('shL', 't');
const user = resp.data;
let avatar = user.avatar;
if (!avatar) {
@ -221,8 +224,6 @@ export const meRequestAsync = (): ThunkAction<void, RootState, unknown, Action<s
const savedToken = sessionStorage.getItem('tk');
if (savedToken) {
if (savedToken != encodeToken) {
sessionStorage.setItem('shT', 't');
sessionStorage.setItem('shL', 't');
sessionStorage.setItem('tk', encodeToken);
firstClick(token);
const energyCode = btoa(energy.toString());
@ -254,6 +255,7 @@ export const meRequestAsync = (): ThunkAction<void, RootState, unknown, Action<s
maxStorage: Number(user.max_storage)
};
dispatch(meRequestSuccess(userData));
loadNewRank();
}).catch((err) => {
console.log(err);
if (err.response.data.detail) {

View File

@ -2,10 +2,8 @@ import { getTgUserId } from "./verification";
export const isWhiteList = () => {
let isWhiteList = false;
//123456,
const whiteList = [
342495217, 6374536117, 322861155, 5219438370, 193428034, 402449803,
406350282, 1083462027
//TODO!
];
const userId = Number(getTgUserId());