Commit d96d3dfb by zhaochengxiang

bug fix

parent 9fccf18f
......@@ -370,8 +370,12 @@ const AssetTable = (props) => {
},
callback: data => {
const anchorLocation = data.offset;
const _pageNum = parseInt(anchorLocation/pageSize + ((anchorLocation%pageSize===0)?0:1));
setPagination({ ...pagination, pageNum: _pageNum });
if (anchorLocation > 0) {
const _pageNum = parseInt(anchorLocation/pageSize + ((anchorLocation%pageSize===0)?0:1));
setPagination({ ...pagination, pageNum: _pageNum });
} else {
setPagination({ ...pagination, pageNum: 1 });
}
},
error: () => {
setLoading(false);
......@@ -392,8 +396,12 @@ const AssetTable = (props) => {
},
callback: data => {
const anchorLocation = data.offset;
const _pageNum = parseInt(anchorLocation/pageSize + ((anchorLocation%pageSize===0)?0:1));
setPagination({ ...pagination, pageNum: _pageNum });
if (anchorLocation > 0) {
const _pageNum = parseInt(anchorLocation/pageSize + ((anchorLocation%pageSize===0)?0:1));
setPagination({ ...pagination, pageNum: _pageNum });
} else {
setPagination({ ...pagination, pageNum: 1 });
}
},
error: () => {
setLoading(false);
......
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