mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 21:06:42 +07:00
optimizedbig amount of data rendering
This commit is contained in:
parent
383990d556
commit
d9f39a8d67
3 changed files with 92 additions and 50 deletions
|
@ -17,7 +17,7 @@ import { IFlowState } from './reducer';
|
|||
|
||||
function* onGetFlow() {
|
||||
const {
|
||||
data: { nodes = null, heroes = null, recent = [], updated = [] },
|
||||
data: { nodes = [], heroes = [], recent = [], updated = [] },
|
||||
}: IResultWithStatus<{
|
||||
nodes: IFlowState['nodes'];
|
||||
heroes: IFlowState['heroes'];
|
||||
|
@ -25,13 +25,13 @@ function* onGetFlow() {
|
|||
updated: IFlowState['updated'];
|
||||
}> = yield call(reqWrapper, getNodes, {});
|
||||
|
||||
if (!nodes || !nodes.length) {
|
||||
yield put(flowSetNodes([]));
|
||||
yield put(flowSetHeroes([]));
|
||||
yield put(flowSetRecent([]));
|
||||
yield put(flowSetUpdated([]));
|
||||
return;
|
||||
}
|
||||
// if (!nodes || !nodes.length) {
|
||||
// yield put(flowSetNodes([]));
|
||||
// yield put(flowSetHeroes([]));
|
||||
// yield put(flowSetRecent([]));
|
||||
// yield put(flowSetUpdated([]));
|
||||
// return;
|
||||
// }
|
||||
|
||||
yield put(flowSetNodes(nodes));
|
||||
yield put(flowSetHeroes(heroes));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue