add win popup
This commit is contained in:
parent
0cb8a5c7a9
commit
c8a3049349
|
@ -14,6 +14,51 @@ export function AuctionMainPopups() {
|
||||||
const [closeAnim, setCloseAnim] = useState(false);
|
const [closeAnim, setCloseAnim] = useState(false);
|
||||||
const topAuctions = useAppSelector<Array<IAuctionItem> | undefined>(state=>state.me.data.topAuctions);
|
const topAuctions = useAppSelector<Array<IAuctionItem> | undefined>(state=>state.me.data.topAuctions);
|
||||||
const loseAuctions = useAppSelector<Array<IAuctionItem> | undefined>(state => state.me.data.loseAuctions);
|
const loseAuctions = useAppSelector<Array<IAuctionItem> | undefined>(state => state.me.data.loseAuctions);
|
||||||
|
const winAuctions = useAppSelector<Array<IAuctionItem> | undefined>(state => state.me.data.winAuctions);
|
||||||
|
const [winInfo, setWinInfo] = useState<IAuctionItem>();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let showWindow = false;
|
||||||
|
if (winAuctions && winAuctions.length != 0) {
|
||||||
|
for (let i = 0; i < winAuctions.length; i++) {
|
||||||
|
const winShow = localStorage.getItem('wS');
|
||||||
|
if (winShow) {
|
||||||
|
const winArray = JSON.parse(winShow);
|
||||||
|
if (winArray && winArray.length != 0) {
|
||||||
|
let isExist = false;
|
||||||
|
for (let k = 0; k < winArray.length; k++) {
|
||||||
|
if (Number(winArray[k]) === Number(winAuctions[i].id)) {
|
||||||
|
isExist = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!isExist) {
|
||||||
|
winArray.push(winAuctions[i].id);
|
||||||
|
localStorage.setItem('wS', JSON.stringify(winArray));
|
||||||
|
showWindow = true;
|
||||||
|
setWinInfo(winAuctions[i]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const newArray = [];
|
||||||
|
newArray.push(winAuctions[i].id);
|
||||||
|
localStorage.setItem('wS', JSON.stringify(newArray));
|
||||||
|
showWindow = true;
|
||||||
|
setWinInfo(winAuctions[i]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const newArray = [];
|
||||||
|
newArray.push(winAuctions[i].id);
|
||||||
|
localStorage.setItem('wS', JSON.stringify(newArray));
|
||||||
|
showWindow = true;
|
||||||
|
setWinInfo(winAuctions[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(showWindow) {
|
||||||
|
setCloseWin(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
}, [winAuctions]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const show = sessionStorage.getItem('shT');
|
const show = sessionStorage.getItem('shT');
|
||||||
|
@ -38,7 +83,7 @@ export function AuctionMainPopups() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{!closeWin && <ModalWindow closeAnimOut={closeAnim} setCloseAnimOut={setCloseAnim} setClose={setCloseWin} removeBtn={true} modalBlock={
|
{!closeWin && <ModalWindow closeAnimOut={closeAnim} setCloseAnimOut={setCloseAnim} setClose={setCloseWin} removeBtn={true} modalBlock={
|
||||||
<AuctionWinPopup name='iPhone 15 Pro Max ' img='' setClose={setCloseAnim}/>
|
<AuctionWinPopup name={winInfo?.name ? winInfo?.name : ''} img={winInfo?.img ? winInfo?.img : ''} setClose={setCloseAnim}/>
|
||||||
} />}
|
} />}
|
||||||
{!closeTop && topAuctions != undefined && <ModalWindow closeAnimOut={closeAnim} setCloseAnimOut={setCloseAnim} setClose={setCloseTop} removeBtn={true} modalBlock={
|
{!closeTop && topAuctions != undefined && <ModalWindow closeAnimOut={closeAnim} setCloseAnimOut={setCloseAnim} setClose={setCloseTop} removeBtn={true} modalBlock={
|
||||||
<AuctionTopPopup items={topAuctions} setClose={setCloseAnim}/>
|
<AuctionTopPopup items={topAuctions} setClose={setCloseAnim}/>
|
||||||
|
|
|
@ -67,7 +67,7 @@ export function AuctionPopup({ setClose, setCloseErrorBet, auctionId, img, name,
|
||||||
dispatch<any>(updatePointsRequestAsync());
|
dispatch<any>(updatePointsRequestAsync());
|
||||||
dispatch<any>(updateAuction(auctionId));
|
dispatch<any>(updateAuction(auctionId));
|
||||||
setBet(bet);
|
setBet(bet);
|
||||||
setLead(true);
|
//setLead(true);
|
||||||
const timer = setInterval(() => {
|
const timer = setInterval(() => {
|
||||||
setCloseResultPopup(false);
|
setCloseResultPopup(false);
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
|
|
|
@ -16,6 +16,7 @@ export function Timer({initTime}: ITimer) {
|
||||||
const tick = () => {
|
const tick = () => {
|
||||||
if (hour === 0 && min === 0 && sec === 0) {
|
if (hour === 0 && min === 0 && sec === 0) {
|
||||||
setOver(true);
|
setOver(true);
|
||||||
|
window.location.reload();
|
||||||
} else if (min === 0 && sec === 0) {
|
} else if (min === 0 && sec === 0) {
|
||||||
setTime([hour - 1, 59, 59]);
|
setTime([hour - 1, 59, 59]);
|
||||||
} else if (sec == 0) {
|
} else if (sec == 0) {
|
||||||
|
|
|
@ -49,24 +49,25 @@ export function PointsZoom({ points, sameInterval, setSameInterval, sameCoords,
|
||||||
let initSameInterval = sameInterval;
|
let initSameInterval = sameInterval;
|
||||||
let avtTime = 500;
|
let avtTime = 500;
|
||||||
if (points > 1) {
|
if (points > 1) {
|
||||||
avtTime = clickTimeInit / (initPoints - 1);
|
avtTime = clickTimeInit / initPoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
setClickTime(0);
|
setClickTime(0);
|
||||||
setSameCoords(false);
|
setSameCoords(false);
|
||||||
|
|
||||||
if ((avtTime < 100 && initSameCoords) || (initSameInterval) && initPoints > 20) {
|
|
||||||
|
|
||||||
/*axios.post(`${URL}/api/v1/users/warn/`, {}, {
|
|
||||||
|
if ((avtTime < 100 && initPoints > 20) || (avtTime < 130 && initPoints > 300)) {
|
||||||
|
|
||||||
|
axios.post(`${URL}/api/v1/users/warn/`, {}, {
|
||||||
headers: {
|
headers: {
|
||||||
"Authorization": `TelegramToken ${token}`
|
"Authorization": `TelegramToken ${token}`
|
||||||
}
|
}
|
||||||
}).then(resp => {
|
}).then(resp => {
|
||||||
console.log(resp);
|
//console.log(resp);
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
//console.log(err)
|
//console.log(err)
|
||||||
})*/
|
})
|
||||||
sendAutoClickData(userData.tgId, points, avtTime);
|
//sendAutoClickData(userData.tgId, points, avtTime);
|
||||||
setCloseAutoClick(false);
|
setCloseAutoClick(false);
|
||||||
setSameInterval(false);
|
setSameInterval(false);
|
||||||
const returnEnergy = energy + initPoints;
|
const returnEnergy = energy + initPoints;
|
||||||
|
|
|
@ -29,7 +29,9 @@ export function AuctionPage() {
|
||||||
{errorAuction ? <ErrorPage fullScreen={true} title='Возникла ошибка загрузки аукционов' text='Перезагрузите страницу или попробуйте позже' detail={errorAuction} /> :
|
{errorAuction ? <ErrorPage fullScreen={true} title='Возникла ошибка загрузки аукционов' text='Перезагрузите страницу или попробуйте позже' detail={errorAuction} /> :
|
||||||
<div>
|
<div>
|
||||||
<h1 className={styles.title} style={ETextStyles.RwSb26100}> <span>Соревнуйся за товары</span> на аукционе!</h1>
|
<h1 className={styles.title} style={ETextStyles.RwSb26100}> <span>Соревнуйся за товары</span> на аукционе!</h1>
|
||||||
{auctionBlock}
|
{dataAuction.length != 0 ? auctionBlock
|
||||||
|
: <p style={ETextStyles.InRg14120}>Скоро тут появятся новые аукционы.</p>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,15 +7,16 @@ interface IErrorPage {
|
||||||
detail: String,
|
detail: String,
|
||||||
title?: string,
|
title?: string,
|
||||||
text?: string,
|
text?: string,
|
||||||
fullScreen ?: boolean
|
fullScreen ?: boolean,
|
||||||
|
isBtn?: boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ErrorPage({ detail, title, text, fullScreen=true }: IErrorPage) {
|
export function ErrorPage({ detail, title, text, fullScreen = true, isBtn=true }: IErrorPage) {
|
||||||
return (
|
return (
|
||||||
<div className={`${styles.container} ${fullScreen ? styles.fullscreen : styles.margin}`}>
|
<div className={`${styles.container} ${fullScreen ? styles.fullscreen : styles.margin}`}>
|
||||||
<h1 className={styles.title} style={ETextStyles.RwSb24100}>{title ? title : 'Возникла ошибка при загрузке ваших данных'}</h1>
|
<h1 className={styles.title} style={ETextStyles.RwSb24100}>{title ? title : 'Возникла ошибка при загрузке ваших данных'}</h1>
|
||||||
<p className={styles.text} style={ETextStyles.RwSb14120}>{text ? text : 'Попробуйте перезагрузить страницу или войдите позже.'}</p>
|
<p className={styles.text} style={ETextStyles.RwSb14120}>{text ? text : 'Попробуйте перезагрузить страницу или войдите позже.'}</p>
|
||||||
<Button text='Перезагрузить' stroke={true} onClick={() => window.location.reload()}/>
|
{isBtn && <Button text='Перезагрузить' stroke={true} onClick={() => window.location.reload()}/>}
|
||||||
{detail.length > 0 && <p className={styles.detail} style={ETextStyles.RwRg12120}>{detail}</p>}
|
{detail.length > 0 && <p className={styles.detail} style={ETextStyles.RwRg12120}>{detail}</p>}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import styles from './routepage.module.css';
|
import styles from './routepage.module.css';
|
||||||
import { WrongSourcePage } from '../WrongSourcePage';
|
import { WrongSourcePage } from '../WrongSourcePage';
|
||||||
import { ClickerPage } from '../ClickerPage';
|
import { ClickerPage } from '../ClickerPage';
|
||||||
|
@ -15,6 +15,10 @@ import { ErrorPage } from '../ErrorPage';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { DevPage } from '../DevPage';
|
import { DevPage } from '../DevPage';
|
||||||
import { useRankData } from '../../hooks/useRankData';
|
import { useRankData } from '../../hooks/useRankData';
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
import { loadWinAuction } from '../../../store/auction/actions';
|
||||||
|
import { useAppSelector } from '../../hooks/useAppSelector';
|
||||||
|
import { checkMobile } from '../../../utils/checkMobile';
|
||||||
|
|
||||||
interface IRoutePage {
|
interface IRoutePage {
|
||||||
page: string
|
page: string
|
||||||
|
@ -23,12 +27,19 @@ interface IRoutePage {
|
||||||
export function RoutePage({ page }: IRoutePage) {
|
export function RoutePage({ page }: IRoutePage) {
|
||||||
const verified = useTgData();
|
const verified = useTgData();
|
||||||
const { dataUser, loadingUser, errorUser } = useUserData();
|
const { dataUser, loadingUser, errorUser } = useUserData();
|
||||||
|
const token = useAppSelector<string>(state => state.token);
|
||||||
|
const [mobile, setMobile] = useState(false);
|
||||||
useRankData();
|
useRankData();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const dispatch = useDispatch();
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
const tg = window.Telegram.WebApp;
|
const tg = window.Telegram.WebApp;
|
||||||
var BackButton = tg.BackButton;
|
var BackButton = tg.BackButton;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
dispatch<any>(loadWinAuction());
|
||||||
|
}, [token]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
updateBackground(page);
|
updateBackground(page);
|
||||||
updateStyles();
|
updateStyles();
|
||||||
|
@ -43,19 +54,26 @@ export function RoutePage({ page }: IRoutePage) {
|
||||||
navigate(-1);
|
navigate(-1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setMobile(checkMobile());
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{!verified ? <WrongSourcePage /> : <div>
|
{!mobile ? <ErrorPage title='Войдите через мобильное устройство' text='Приложение доступно только в мобильном приложении Telegram.' isBtn={false} detail={''} /> :
|
||||||
{ //@ts-ignore
|
<div>
|
||||||
page === 'main' && (!loadingUser || dataUser.username) && !errorUser && dataUser.name && <ClickerPage name={dataUser.name} points={Number(dataUser.points)} img={dataUser.avatar} energy={Number(dataUser.energy)}/>}
|
{!verified ? <WrongSourcePage /> : <div>
|
||||||
{page === 'rating' && (!loadingUser || dataUser.username) && !errorUser && <RatingPage />}
|
{ //@ts-ignore
|
||||||
{page === 'referral' && (!loadingUser || dataUser.username) && !errorUser && <StoragePage />}
|
page === 'main' && (!loadingUser || dataUser.username) && !errorUser && dataUser.name && <ClickerPage name={dataUser.name} points={Number(dataUser.points)} img={dataUser.avatar} energy={Number(dataUser.energy)} />}
|
||||||
{page === 'auction' && (!loadingUser || dataUser.username) && !errorUser && <AuctionPage />}
|
{page === 'rating' && (!loadingUser || dataUser.username) && !errorUser && <RatingPage />}
|
||||||
{page === 'styles' && (!loadingUser || dataUser.username) && !errorUser && <StylesPage />}
|
{page === 'referral' && (!loadingUser || dataUser.username) && !errorUser && <StoragePage />}
|
||||||
{page === 'dev' && <DevPage/>}
|
{page === 'auction' && (!loadingUser || dataUser.username) && !errorUser && <AuctionPage />}
|
||||||
{(loadingUser) && <div className={styles.spinnerContainer}><Spinner color='#FFFFFF' size='50px' thickness='6px' className={styles.spinner} /></div> }
|
{page === 'styles' && (!loadingUser || dataUser.username) && !errorUser && <StylesPage />}
|
||||||
{errorUser && !loadingUser && <ErrorPage detail={errorUser}/>}
|
{page === 'dev' && <DevPage />}
|
||||||
</div>}
|
{(loadingUser) && <div className={styles.spinnerContainer}><Spinner color='#FFFFFF' size='50px' thickness='6px' className={styles.spinner} /></div>}
|
||||||
|
{errorUser && !loadingUser && <ErrorPage detail={errorUser} />}
|
||||||
|
</div>}
|
||||||
|
</div> }
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,7 @@ export const auctionRequestAsync = (): ThunkAction<void, RootState, unknown, Act
|
||||||
const userTg = getState().userTg.id;
|
const userTg = getState().userTg.id;
|
||||||
|
|
||||||
if (token) {
|
if (token) {
|
||||||
|
dispatch(auctionRequest());
|
||||||
axios.get(`${URL}/api/v1/auction/auction?is_active=true`,
|
axios.get(`${URL}/api/v1/auction/auction?is_active=true`,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -88,9 +89,12 @@ export const auctionRequestAsync = (): ThunkAction<void, RootState, unknown, Act
|
||||||
const loseAuctions = [];
|
const loseAuctions = [];
|
||||||
|
|
||||||
for (let i = 0; i < data.length; i++) {
|
for (let i = 0; i < data.length; i++) {
|
||||||
const active = Boolean(data[i].is_active);
|
let active = true;
|
||||||
const nowDate = new Date();
|
const nowDate = new Date();
|
||||||
const endDate = new Date(data[i].end_time);
|
const endDate = new Date(data[i].end_time);
|
||||||
|
if (nowDate > endDate) {
|
||||||
|
active = false;
|
||||||
|
}
|
||||||
const time = Math.ceil(Math.abs(endDate.getTime() - nowDate.getTime()) / 1000);
|
const time = Math.ceil(Math.abs(endDate.getTime() - nowDate.getTime()) / 1000);
|
||||||
let maxBet = Number(data[i].initial_cost);
|
let maxBet = Number(data[i].initial_cost);
|
||||||
let isLead = false;
|
let isLead = false;
|
||||||
|
@ -108,12 +112,13 @@ export const auctionRequestAsync = (): ThunkAction<void, RootState, unknown, Act
|
||||||
isLead = true;
|
isLead = true;
|
||||||
|
|
||||||
const topItem = {
|
const topItem = {
|
||||||
|
id: data[i].id,
|
||||||
name: data[i].product.name,
|
name: data[i].product.name,
|
||||||
img: data[i].product.cover,
|
img: data[i].product.cover,
|
||||||
bet: dataBet[k].value
|
bet: dataBet[k].value
|
||||||
}
|
}
|
||||||
|
|
||||||
if(active) {
|
if (active) {
|
||||||
topAuctions.push(topItem);
|
topAuctions.push(topItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,14 +132,15 @@ export const auctionRequestAsync = (): ThunkAction<void, RootState, unknown, Act
|
||||||
if (Number(userData[z].value) > myBet) {
|
if (Number(userData[z].value) > myBet) {
|
||||||
myBet = Number(userData[z].value);
|
myBet = Number(userData[z].value);
|
||||||
|
|
||||||
if(!isLead) {
|
if (!isLead) {
|
||||||
const loseItem = {
|
const loseItem = {
|
||||||
|
id: data[i].id,
|
||||||
name: data[i].product.name,
|
name: data[i].product.name,
|
||||||
img: data[i].product.cover,
|
img: data[i].product.cover,
|
||||||
bet: userData[z].value
|
bet: userData[z].value
|
||||||
}
|
}
|
||||||
|
|
||||||
if(active) {
|
if (active) {
|
||||||
loseAuctions.push(loseItem)
|
loseAuctions.push(loseItem)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,7 +162,7 @@ export const auctionRequestAsync = (): ThunkAction<void, RootState, unknown, Act
|
||||||
myBet: myBet.toString()
|
myBet: myBet.toString()
|
||||||
};
|
};
|
||||||
|
|
||||||
if(active) {
|
if (active) {
|
||||||
auctionResults.push(item);
|
auctionResults.push(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -250,3 +256,55 @@ export const updateAuction = (id: string): ThunkAction<void, RootState, unknown,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export const loadWinAuction = (): ThunkAction<void, RootState, unknown, Action<string>> => (dispatch, getState) => {
|
||||||
|
const URL = getState().url;
|
||||||
|
const token = getState().token;
|
||||||
|
const userId = getState().userTg.id;
|
||||||
|
|
||||||
|
if (token) {
|
||||||
|
axios.get(`${URL}/api/v1/auction/auction?is_active=false`,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
"Authorization": `TelegramToken ${token}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
).then(resp => {
|
||||||
|
const dataOver = resp.data.results;
|
||||||
|
|
||||||
|
axios.get(`${URL}/api/v1/auction/bet?order_by=-value&is_winning=true`,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
"Authorization": `TelegramToken ${token}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
).then(resp2 => {
|
||||||
|
const dataBet = resp2.data.results;
|
||||||
|
const winAuctions = [];
|
||||||
|
|
||||||
|
if (dataBet.length != 0) {
|
||||||
|
if (dataOver.length != 0) {
|
||||||
|
for (let i = 0; i < dataOver.length; i++) {
|
||||||
|
for (let k = 0; k < dataBet.length; k++) {
|
||||||
|
if (dataOver[i].id === dataBet[k].auction) {
|
||||||
|
if (Number(userId) === Number(dataBet[k].user.tg_id)) {
|
||||||
|
const item = {
|
||||||
|
id: dataOver[i].id,
|
||||||
|
name: dataOver[i].product.name,
|
||||||
|
img: dataOver[i].product.cover,
|
||||||
|
bet: dataBet[k].value
|
||||||
|
}
|
||||||
|
winAuctions.push(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dispatch(updateMyAuctions(winAuctions, 'win'));
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
|
@ -52,6 +52,7 @@ export const friendsRequestAsync = (): ThunkAction<void, RootState, unknown, Act
|
||||||
const userTg = getState().userTg.id;
|
const userTg = getState().userTg.id;
|
||||||
|
|
||||||
if(token) {
|
if(token) {
|
||||||
|
dispatch(friendsRequest());
|
||||||
axios.get(`${URL}/api/v1/users/rank/friends`,
|
axios.get(`${URL}/api/v1/users/rank/friends`,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { saveMult } from "../mult";
|
||||||
import { saveToken } from "../token";
|
import { saveToken } from "../token";
|
||||||
|
|
||||||
export interface IAuctionItem {
|
export interface IAuctionItem {
|
||||||
|
id: string,
|
||||||
name: string,
|
name: string,
|
||||||
img: string,
|
img: string,
|
||||||
bet: string
|
bet: string
|
||||||
|
@ -23,6 +24,7 @@ export interface IUserData {
|
||||||
rank ?: number,
|
rank ?: number,
|
||||||
loseAuctions?: Array<IAuctionItem>,
|
loseAuctions?: Array<IAuctionItem>,
|
||||||
topAuctions?: Array<IAuctionItem>,
|
topAuctions?: Array<IAuctionItem>,
|
||||||
|
winAuctions?: Array<IAuctionItem>,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ME_REQUEST = 'ME_REQUEST';
|
export const ME_REQUEST = 'ME_REQUEST';
|
||||||
|
@ -369,6 +371,8 @@ export const updateMyAuctions = (data: Array<IAuctionItem>, type: string): Thunk
|
||||||
|
|
||||||
if(type === 'top') {
|
if(type === 'top') {
|
||||||
newData.topAuctions = data;
|
newData.topAuctions = data;
|
||||||
|
} else if(type === 'win') {
|
||||||
|
newData.winAuctions = data;
|
||||||
} else {
|
} else {
|
||||||
newData.loseAuctions = data;
|
newData.loseAuctions = data;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,7 @@ export const rankRequestAsync = (): ThunkAction<void, RootState, unknown, Action
|
||||||
const result: Array<IUserRank> = [];
|
const result: Array<IUserRank> = [];
|
||||||
|
|
||||||
if(token) {
|
if(token) {
|
||||||
|
dispatch(rankRequest());
|
||||||
axios.get(`${URL}/api/v1/users/rank/top?limit=3`,
|
axios.get(`${URL}/api/v1/users/rank/top?limit=3`,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { getTgUserId } from "./verification";
|
||||||
|
|
||||||
export const isWhiteList = () => {
|
export const isWhiteList = () => {
|
||||||
let isWhiteList = false;
|
let isWhiteList = false;
|
||||||
|
//123456,
|
||||||
const whiteList = [
|
const whiteList = [
|
||||||
//TODO!
|
//TODO!
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user