Commit 26c2b211 authored by chechunchi's avatar chechunchi

optimize pull deck progress

parent afdee64c
Pipeline #28805 passed with stages
in 10 minutes and 38 seconds
...@@ -57,12 +57,15 @@ export const DeckResults: React.FC = memo(() => { ...@@ -57,12 +57,15 @@ export const DeckResults: React.FC = memo(() => {
}, [snap.query, snap.page, snap.onlyMine]); }, [snap.query, snap.page, snap.onlyMine]);
const onChangePage = async (page: number) => { const onChangePage = async (page: number) => {
const resp = await pullDecks({ const resp = await pullDecks(
page, {
size: PAGE_SIZE, page,
keyWord: store.query !== "" ? store.query : undefined, size: PAGE_SIZE,
sortLike: SORT_LIKE, keyWord: store.query !== "" ? store.query : undefined,
}); sortLike: SORT_LIKE,
},
updateProgress,
);
if (resp?.data) { if (resp?.data) {
const { current, total, records } = resp.data; const { current, total, records } = resp.data;
...@@ -174,7 +177,7 @@ const MdproDeckBlock: React.FC<{ ...@@ -174,7 +177,7 @@ const MdproDeckBlock: React.FC<{
); );
}; };
const updateMdproDeck = async () => { export const updateMdproDeck = async () => {
const resp = await pullDecks( const resp = await pullDecks(
{ {
page: store.page, page: store.page,
......
...@@ -28,6 +28,7 @@ import { ...@@ -28,6 +28,7 @@ import {
import { useConfig } from "@/config"; import { useConfig } from "@/config";
import { accountStore } from "@/stores"; import { accountStore } from "@/stores";
import { updateMdproDeck } from "../BuildDeck/DeckDatabase/DeckResults";
import { setCssProperties } from "../Duel/PlayMat/css"; import { setCssProperties } from "../Duel/PlayMat/css";
import { Setting } from "../Setting"; import { Setting } from "../Setting";
import styles from "./index.module.scss"; import styles from "./index.module.scss";
...@@ -52,6 +53,7 @@ export const loader: LoaderFunction = async () => { ...@@ -52,6 +53,7 @@ export const loader: LoaderFunction = async () => {
initForbidden(); initForbidden();
initI18N(); initI18N();
initSuper(); initSuper();
updateMdproDeck();
// set some styles // set some styles
setCssProperties(); setCssProperties();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment