fixed auctions and opened them
This commit is contained in:
parent
6ae11e83d6
commit
0cb8a5c7a9
BIN
frontend/src/.DS_Store
vendored
BIN
frontend/src/.DS_Store
vendored
Binary file not shown.
BIN
frontend/src/shared/.DS_Store
vendored
BIN
frontend/src/shared/.DS_Store
vendored
Binary file not shown.
|
@ -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>
|
||||
|
|
|
@ -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}>
|
||||
|
|
|
@ -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(() => {
|
||||
|
|
|
@ -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,11 +113,13 @@ export const auctionRequestAsync = (): ThunkAction<void, RootState, unknown, Act
|
|||
bet: dataBet[k].value
|
||||
}
|
||||
|
||||
if(active) {
|
||||
topAuctions.push(topItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (userData.length != 0) {
|
||||
for (let z = 0; z < userData.length; z++) {
|
||||
|
@ -131,12 +134,14 @@ export const auctionRequestAsync = (): ThunkAction<void, RootState, unknown, Act
|
|||
bet: userData[z].value
|
||||
}
|
||||
|
||||
if(active) {
|
||||
loseAuctions.push(loseItem)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const item = {
|
||||
id: data[i].id,
|
||||
|
@ -151,8 +156,10 @@ export const auctionRequestAsync = (): ThunkAction<void, RootState, unknown, Act
|
|||
myBet: myBet.toString()
|
||||
};
|
||||
|
||||
if(active) {
|
||||
auctionResults.push(item);
|
||||
}
|
||||
}
|
||||
|
||||
dispatch(updateMyAuctions(topAuctions, 'top'));
|
||||
dispatch(updateMyAuctions(loseAuctions, 'lose'));
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue
Block a user