mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-18 18:44:01 +00:00
fix(stickers): fix stickers appearing as loading when on a new account
This commit is contained in:
parent
05eb8abf04
commit
d8a90eda6c
@ -7,6 +7,7 @@ QtObject:
|
||||
type
|
||||
View* = ref object of QObject
|
||||
delegate: io_interface.AccessInterface
|
||||
packsLoaded*: bool
|
||||
stickerPacks*: StickerPackList
|
||||
recentStickers*: StickerList
|
||||
|
||||
@ -100,7 +101,15 @@ QtObject:
|
||||
proc addRecentStickerToList*(self: View, sticker: Item) =
|
||||
self.recentStickers.addStickerToList(sticker)
|
||||
|
||||
proc getAllPacksLoaded(self: View): bool {.slot.} =
|
||||
self.packsLoaded
|
||||
|
||||
QtProperty[bool] packsLoaded:
|
||||
read = getAllPacksLoaded
|
||||
notify = stickerPacksLoaded
|
||||
|
||||
proc allPacksLoaded*(self: View) =
|
||||
self.packsLoaded = true
|
||||
self.stickerPacksLoaded()
|
||||
self.installedStickerPacksUpdated()
|
||||
|
||||
|
@ -47,6 +47,21 @@ Popup {
|
||||
root.close()
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (stickersModule.packsLoaded) {
|
||||
root.setStickersReady()
|
||||
}
|
||||
}
|
||||
|
||||
function setStickersReady() {
|
||||
root.stickerPacksLoaded = true
|
||||
stickerPackListView.visible = true
|
||||
loadingGrid.active = false
|
||||
loadingStickerPackListView.model = []
|
||||
noStickerPacks.visible = installedPacksCount === 0 || stickersModule.recent.rowCount() === 0
|
||||
}
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 0
|
||||
@ -268,13 +283,11 @@ Popup {
|
||||
}
|
||||
}
|
||||
Connections {
|
||||
id: loadedConnection
|
||||
target: stickersModule
|
||||
onStickerPacksLoaded: {
|
||||
root.stickerPacksLoaded = true
|
||||
stickerPackListView.visible = true
|
||||
loadingGrid.active = false
|
||||
loadingStickerPackListView.model = []
|
||||
noStickerPacks.visible = installedPacksCount === 0 || stickersModule.recent.rowCount() === 0
|
||||
root.setStickersReady()
|
||||
loadedConnection.enabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user