Skip to content

Commit f8eb08f

Browse files
committed
Reset current index before clearing in SendRecipientsListModel
1 parent c8c54a1 commit f8eb08f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

qml/models/sendrecipientslistmodel.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ void SendRecipientsListModel::clear()
152152

153153
void SendRecipientsListModel::clearToFront()
154154
{
155+
if (m_current != 0) {
156+
m_current = 0;
157+
Q_EMIT currentRecipientChanged();
158+
Q_EMIT currentIndexChanged();
159+
}
160+
155161
bool count_changed = false;
156162
while (m_recipients.size() > 1) {
157163
delete m_recipients.at(1);
@@ -167,10 +173,4 @@ void SendRecipientsListModel::clearToFront()
167173
m_totalAmount = m_recipients[0]->amount()->satoshi();
168174
Q_EMIT totalAmountChanged();
169175
}
170-
171-
if (m_current != 0) {
172-
m_current = 0;
173-
Q_EMIT currentRecipientChanged();
174-
Q_EMIT currentIndexChanged();
175-
}
176176
}

0 commit comments

Comments
 (0)