Skip to content
Snippets Groups Projects
Commit 041a0322 authored by Evgenii Tagiltsev's avatar Evgenii Tagiltsev
Browse files

[*] fixed filling list of tokens

parent 713b2293
No related branches found
No related tags found
1 merge request!27Bugs 2588
Pipeline #1006 passed with stage
in 3 minutes and 16 seconds
......@@ -153,21 +153,21 @@ void DapCommandController::processGetWalletInfo()
QString name = reply->response().toJsonValue().toVariant().toStringList().at(0);
QString address = reply->response().toJsonValue().toVariant().toStringList().at(1);
QStringList temp = reply->response().toJsonValue().toVariant().toStringList();
QStringList tokens;
QStringList tokens = temp.mid(3, temp.count());
QStringList balance;
for(int x{2}; x < temp.count(); x++)
{
if(x%2)
{
tokens.append(temp[x]);
qDebug() << "TOKKEN " << temp[x];
}
else
{
balance.append(temp[x]);
qDebug() << "BALANCE " << temp[x];
}
}
// for(int x{2}; x < temp.count(); x++)
// {
// if(x%2)
// {
// tokens.append(temp[x]);
// qDebug() << "TOKKEN " << temp[x];
// }
// else
// {
// balance.append(temp[x]);
// qDebug() << "BALANCE " << temp[x];
// }
// }
emit sigWalletInfoChanged(name, address, balance, tokens);
}
......
......@@ -26,11 +26,8 @@ DapUiQmlWidgetStatusBarComboBoxWalletForm {
onCurrentIndexChanged: {
listToken.model.clear();
for(var i = 0; i < dapChainWalletsModel.get(currentIndex).count; i++)
{
console.debug(dapChainWalletsModel.get(currentIndex).tokens);
listToken.model.append({"tokenName": dapChainWalletsModel.get(currentIndex).tokens[++i]});
}
for(var i = 2; i < dapChainWalletsModel.get(currentIndex).count; i += 3)
listToken.model.append({"tokenName": dapChainWalletsModel.get(currentIndex).tokens[i]});
if(listToken.model.count)
listToken.currentIndex = 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment