Update highlighted room when adding new chat

This commit is contained in:
miruka 2020-06-05 01:07:39 -04:00
parent 5402a332d2
commit 43ed7b2eb9
6 changed files with 13 additions and 4 deletions

View File

@ -90,6 +90,9 @@ and this project adheres to
- Correctly handle room topics containing new lines, hard tabs or text inside
`<>` brackets
- Starting a direct chat, creating or joining a room will now correctly
update the left pane room list's highlighted item
## 0.5.0
### Added

View File

@ -1,7 +1,6 @@
# TODO
- fix cursor over field
- update room highlight when creating new room
- keyerror when forgetting room while loading members
## Refactoring

View File

@ -32,7 +32,7 @@ HListView {
onLeftClicked: showItemAtIndex(model.index)
onCollapsedChanged:
if (wantedUserId === model.id) correctTimer.start()
if (wantedUserId === model.id) startCorrectItemSearch()
}
}
@ -69,7 +69,7 @@ HListView {
)
)
)
correctTimer.start()
startCorrectItemSearch()
})
}
@ -165,6 +165,10 @@ HListView {
}
}
function startCorrectItemSearch() {
correctTimer.start()
}
function setCorrectCurrentItem() {
if (! currentShouldBeRoom && ! currentShouldBeAccount) {
currentIndex = -1
@ -196,7 +200,7 @@ HListView {
Connections {
target: pageLoader
onPreviousShown:
if (setCorrectCurrentItem() === false) correctTimer.start()
if (setCorrectCurrentItem() === false) startCorrectItemSearch()
}
Timer {

View File

@ -31,6 +31,7 @@ HBox {
py.callClientCoro(userId, "new_group_chat", args, roomId => {
button.loading = false
pageLoader.showRoom(userId, roomId)
mainPane.roomList.startCorrectItemSearch()
}, (type, args) => {
button.loading = false

View File

@ -31,6 +31,7 @@ HBox {
button.loading = false
errorMessage.text = ""
pageLoader.showRoom(userId, roomId)
mainPane.roomList.startCorrectItemSearch()
}, (type, args) => {
button.loading = false

View File

@ -31,6 +31,7 @@ HBox {
button.loading = false
errorMessage.text = ""
pageLoader.showRoom(userId, roomId)
mainPane.roomList.startCorrectItemSearch()
}, (type, args) => {
button.loading = false