Skip to content

Commit 17c167e

Browse files
authored
Merge pull request #134 from yoution/feature-devices-lookup
fixed issue about loadmore for models and oses fields
2 parents 61a600b + 5e5f4b1 commit 17c167e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/reducers/lookup.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ function onGetModelsDone(state, { payload, error }) {
100100
}
101101

102102
let models = payload;
103+
const hasMore = models.length === PAGE_SIZE;
103104

104105
if (state.modelPage > 1) {
105106
models = [...state.models, ...models];
@@ -111,7 +112,7 @@ function onGetModelsDone(state, { payload, error }) {
111112
...state,
112113
loadingModelsError: false,
113114
models,
114-
hasMoreModels: models.length === PAGE_SIZE,
115+
hasMoreModels: hasMore,
115116
isModelsLoading: false,
116117
});
117118
}
@@ -142,6 +143,7 @@ function onGetOsesDone(state, { payload, error }) {
142143
}
143144

144145
let oses = payload;
146+
const hasMore = oses.length === PAGE_SIZE;
145147
if (state.osPage > 1) {
146148
oses = [...state.oses, ...oses];
147149
}
@@ -152,7 +154,7 @@ function onGetOsesDone(state, { payload, error }) {
152154
...state,
153155
loadingOsesError: false,
154156
oses,
155-
hasMoreOses: oses.length === PAGE_SIZE,
157+
hasMoreOses: hasMore,
156158
isOsesLoading: false,
157159
});
158160
}

0 commit comments

Comments
 (0)