mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Qml app: fixed unread messages count displaying
Roles in models are not expected to change type, so they must be always defined and have the same type
This commit is contained in:
parent
de9a44fac7
commit
c1c1d5ddb4
@ -58,6 +58,7 @@ function mergeContactsUnread()
|
||||
var el = jsonData[i]
|
||||
if(unreadMessages.hasOwnProperty(el.gxs_id))
|
||||
el['unread_count'] = unreadMessages[el.gxs_id]
|
||||
else el['unread_count'] = "0" // This must be string
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,8 +50,6 @@ Item
|
||||
function refreshContactsCallback(par)
|
||||
{
|
||||
console.log("contactsView.refreshContactsCB()", visible)
|
||||
if (contactsListModel.model.count < 1)
|
||||
contactsListModel.json = par.response
|
||||
var token = JSON.parse(par.response).statetoken
|
||||
TokensManager.registerToken(token, refreshContacts)
|
||||
contactsSortWorker.sendMessage(
|
||||
|
@ -79,6 +79,7 @@ Item
|
||||
anchors.rightMargin: 10
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
height: parent.height - 10
|
||||
spacing: 4
|
||||
|
||||
Rectangle
|
||||
{
|
||||
@ -88,15 +89,16 @@ Item
|
||||
antialiasing: true
|
||||
border.color: "blue"
|
||||
border.width: 1
|
||||
height: parent.height
|
||||
height: parent.height - 4
|
||||
radius: height/2
|
||||
width: height
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
Text
|
||||
{
|
||||
color: "white"
|
||||
font.bold: true
|
||||
text: model.unread_count > 0 ? model.unread_count : ''
|
||||
text: model.unread_count
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user