Commit 1f6b1201 authored by Efe's avatar Efe Committed by Jonathan Porta
Browse files

update listVoterProposals action

parent ee3dd2dd
......@@ -23,7 +23,7 @@
"author": "Steemit, Inc.",
"license": "MIT",
"dependencies": {
"@blocktradesdev/steem-js": "~0.7.6",
"@blocktradesdev/steem-js": "0.7.7",
"@steem/crypto-session": "git+https://github.com/steemit/crypto-session.git#83a90b319ce5bc6a70362d52a15a815de7e729bb",
"@steemit/steem-js": "0.7.4",
"assert": "1.4.1",
......
......@@ -108,16 +108,38 @@ export function* listVoterProposals({
resolve,
reject,
}) {
let voterProposals;
while (!voterProposals) {
voterProposals = yield call(
let voterProposals = { [start]: [] };
let last_id = null;
let isLast = false;
while (!isLast) {
const data = yield call(
[api, api.listVoterProposalsAsync],
start,
order_by,
order_direction,
limit,
status
status,
last_id
);
if (data) {
if (!data.hasOwnProperty(start)) {
isLast = true;
} else {
let proposals = [];
if (data[start].length < limit) {
proposals = [...voterProposals[start], ...data[start]];
isLast = true;
} else {
last_id = data[start][data[start].length - 1]['id'];
proposals = [...voterProposals[start], ...data[start]];
}
voterProposals = { [start]: proposals };
}
}
}
yield put(globalActions.receiveListVoterProposals({ voterProposals }));
......
......@@ -10,10 +10,10 @@
esutils "^2.0.2"
js-tokens "^3.0.0"
"@blocktradesdev/steem-js@^0.7.5":
version "0.7.5"
resolved "https://registry.yarnpkg.com/@blocktradesdev/steem-js/-/steem-js-0.7.5.tgz#56ed2a5234f24b86d4b920c937c0107492a8c63c"
integrity sha512-HW9/W8a/RPWGDdlRXcPb1KHCaCeDIjXXHrgNl+T+eus8qlluHcIiHk44dlDbL+9/LxtDCerSceGVD/J6UNsxXA==
"@blocktradesdev/steem-js@0.7.7":
version "0.7.7"
resolved "https://registry.yarnpkg.com/@blocktradesdev/steem-js/-/steem-js-0.7.7.tgz#83bde7b5f446c36f009c250d946b345f66067eef"
integrity sha512-fWDjjEbut3x0TH2CdGSfVwTDEhLravrsl4RI2q6oVv2HsBqwXczO4Jl5QJmky7wXKGY9rRpMKhXMtVNE9dQ7WA==
dependencies:
"@steemit/rpc-auth" "^1.1.1"
bigi "^1.4.2"
......
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