ui: fix q controls session list refresh method
This commit is contained in:
parent
f621f6ac00
commit
88addf6e4a
7 changed files with 13 additions and 17 deletions
|
|
@ -38,10 +38,9 @@ function QueueControls(props: Props) {
|
||||||
const totalPages = Math.ceil(total / PER_PAGE);
|
const totalPages = Math.ceil(total / PER_PAGE);
|
||||||
const index = sessionIds.indexOf(sessionId);
|
const index = sessionIds.indexOf(sessionId);
|
||||||
|
|
||||||
// check for the last page and load the next
|
|
||||||
if (currentPage !== totalPages && index === sessionIds.length - 1) {
|
if (currentPage !== totalPages && index === sessionIds.length - 1) {
|
||||||
searchStore
|
sessionStore
|
||||||
.fetchAutoplaySessions(currentPage + 1)
|
.fetchAutoplayList(currentPage + 1)
|
||||||
.then(setAutoplayValues);
|
.then(setAutoplayValues);
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import './styles/index.scss';
|
import './styles/index.css';
|
||||||
|
import './styles/global.scss'
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { createRoot } from 'react-dom/client';
|
import { createRoot } from 'react-dom/client';
|
||||||
import './init';
|
import './init';
|
||||||
|
|
|
||||||
|
|
@ -513,17 +513,17 @@ export default class SessionStore {
|
||||||
this.totalLiveSessions = data.total
|
this.totalLiveSessions = data.total
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchAutoplayList = async (params = {}) => {
|
fetchAutoplayList = async (page: number) => {
|
||||||
try {
|
try {
|
||||||
setSessionFilter(cleanSessionFilters(params));
|
const filter = searchStore.instance.toSearch();
|
||||||
const data = await sessionService.getAutoplayList(params);
|
setSessionFilter(cleanSessionFilters(filter));
|
||||||
this.sessionIds = this.sessionIds
|
const data = await sessionService.getAutoplayList({ ...filter, page: page });
|
||||||
.concat(data.map((i: any) => i.sessionId + ''))
|
const ids = data.map((i: any) => i.sessionId + '').filter((i, index) => !this.sessionIds.includes(i));
|
||||||
.filter((i, index) => this.sessionIds.indexOf(i) === index);
|
this.sessionIds = this.sessionIds.concat(ids);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
clearList = () => {
|
clearList = () => {
|
||||||
this.list = [];
|
this.list = [];
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,8 @@ input.no-focus:focus {
|
||||||
@apply rounded-lg shadow-sm border bg-white;
|
@apply rounded-lg shadow-sm border bg-white;
|
||||||
}
|
}
|
||||||
|
|
||||||
@layer base {
|
img {
|
||||||
img {
|
@apply inline-block;
|
||||||
@apply inline-block;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.lucide {
|
.lucide {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
@import "./theme";
|
|
||||||
@import "./global";
|
|
||||||
@import "./reset.css";
|
@import "./reset.css";
|
||||||
@import "./import.css";
|
@import "./import.css";
|
||||||
@import "./main.css";
|
@import "./main.css";
|
||||||
Loading…
Add table
Reference in a new issue