fix(StatusStickerPackClickPopup): fix crash

the button to (un)install would be either greyed out or result in a crash:
- we were passing the popup a wrong store (w/o networkConnectionStore)
- the condition to `greyedOut` was inverted
This commit is contained in:
Lukáš Tinkl 2023-04-12 13:23:33 +02:00 committed by Lukáš Tinkl
parent 86a58d3298
commit e506bbfd6b
2 changed files with 2 additions and 3 deletions

View File

@ -87,7 +87,7 @@ StatusSectionLayout {
emojiPopup: root.emojiPopup emojiPopup: root.emojiPopup
stickersPopup: root.stickersPopup stickersPopup: root.stickersPopup
onOpenStickerPackPopup: { onOpenStickerPackPopup: {
Global.openPopup(statusStickerPackClickPopup, {packId: stickerPackId} ) Global.openPopup(statusStickerPackClickPopup, {packId: stickerPackId, store: root.stickersPopup.store} )
} }
onOpenAppSearch: { onOpenAppSearch: {
root.openAppSearch(); root.openAppSearch();
@ -167,7 +167,6 @@ StatusSectionLayout {
Component { Component {
id: statusStickerPackClickPopup id: statusStickerPackClickPopup
StatusStickerPackClickPopup{ StatusStickerPackClickPopup{
store: root.rootStore
onClosed: { onClosed: {
destroy(); destroy();
} }

View File

@ -125,7 +125,7 @@ ModalPopup {
isInstalled: installed isInstalled: installed
isBought: bought isBought: bought
isPending: pending isPending: pending
greyedOut: store.networkConnectionStore.stickersNetworkAvailable greyedOut: !store.networkConnectionStore.stickersNetworkAvailable
tooltip.text: store.networkConnectionStore.stickersNetworkUnavailableText tooltip.text: store.networkConnectionStore.stickersNetworkUnavailableText
onInstallClicked: { onInstallClicked: {
stickersModule.install(packId); stickersModule.install(packId);