mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-31 08:44:57 +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
|
type
|
||||||
View* = ref object of QObject
|
View* = ref object of QObject
|
||||||
delegate: io_interface.AccessInterface
|
delegate: io_interface.AccessInterface
|
||||||
|
packsLoaded*: bool
|
||||||
stickerPacks*: StickerPackList
|
stickerPacks*: StickerPackList
|
||||||
recentStickers*: StickerList
|
recentStickers*: StickerList
|
||||||
|
|
||||||
@ -100,7 +101,15 @@ QtObject:
|
|||||||
proc addRecentStickerToList*(self: View, sticker: Item) =
|
proc addRecentStickerToList*(self: View, sticker: Item) =
|
||||||
self.recentStickers.addStickerToList(sticker)
|
self.recentStickers.addStickerToList(sticker)
|
||||||
|
|
||||||
|
proc getAllPacksLoaded(self: View): bool {.slot.} =
|
||||||
|
self.packsLoaded
|
||||||
|
|
||||||
|
QtProperty[bool] packsLoaded:
|
||||||
|
read = getAllPacksLoaded
|
||||||
|
notify = stickerPacksLoaded
|
||||||
|
|
||||||
proc allPacksLoaded*(self: View) =
|
proc allPacksLoaded*(self: View) =
|
||||||
|
self.packsLoaded = true
|
||||||
self.stickerPacksLoaded()
|
self.stickerPacksLoaded()
|
||||||
self.installedStickerPacksUpdated()
|
self.installedStickerPacksUpdated()
|
||||||
|
|
||||||
|
@ -47,6 +47,21 @@ Popup {
|
|||||||
root.close()
|
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 {
|
contentItem: ColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
spacing: 0
|
spacing: 0
|
||||||
@ -268,13 +283,11 @@ Popup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
|
id: loadedConnection
|
||||||
target: stickersModule
|
target: stickersModule
|
||||||
onStickerPacksLoaded: {
|
onStickerPacksLoaded: {
|
||||||
root.stickerPacksLoaded = true
|
root.setStickersReady()
|
||||||
stickerPackListView.visible = true
|
loadedConnection.enabled = false
|
||||||
loadingGrid.active = false
|
|
||||||
loadingStickerPackListView.model = []
|
|
||||||
noStickerPacks.visible = installedPacksCount === 0 || stickersModule.recent.rowCount() === 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user