From a6adb9eddb66a95b187f41621927b2a5bc9eaf96 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 25 Oct 2024 14:12:37 -0400 Subject: [PATCH] fix(gifs): fix call to setGifUnfurlingEnabled using a bad store (#16622) Fixes #16598 The gif popup was using the global RootStore, but it didn't work and it's also not a good practice. I moved the function to enable to the GifStore which is accessible as a reference instead. --- ui/imports/shared/status/StatusGifPopup.qml | 2 +- ui/imports/shared/stores/GifStore.qml | 4 ++++ ui/imports/shared/stores/RootStore.qml | 4 ---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/imports/shared/status/StatusGifPopup.qml b/ui/imports/shared/status/StatusGifPopup.qml index eb61b50400..b2ecdbd40f 100644 --- a/ui/imports/shared/status/StatusGifPopup.qml +++ b/ui/imports/shared/status/StatusGifPopup.qml @@ -206,7 +206,7 @@ Popup { visible: true onEnableGifsRequested: { - RootStore.setGifUnfurlingEnabled(true) + root.gifStore.setGifUnfurlingEnabled(true) root.gifStore.getTrendingsGifs() } } diff --git a/ui/imports/shared/stores/GifStore.qml b/ui/imports/shared/stores/GifStore.qml index 983cb3cbd3..32e1bf8a7e 100644 --- a/ui/imports/shared/stores/GifStore.qml +++ b/ui/imports/shared/stores/GifStore.qml @@ -13,6 +13,10 @@ QtObject { property var gifColumnC: d.gifsModuleInst ? d.gifsModuleInst.gifColumnC : null property bool gifLoading: d.gifsModuleInst ? d.gifsModuleInst.gifLoading : false + function setGifUnfurlingEnabled(value) { + localAccountSensitiveSettings.gifUnfurlingEnabled = value + } + function searchGifs(query) { if (d.gifsModuleInst) d.gifsModuleInst.searchGifs(query) diff --git a/ui/imports/shared/stores/RootStore.qml b/ui/imports/shared/stores/RootStore.qml index 62dcc73f3b..e533169c0b 100644 --- a/ui/imports/shared/stores/RootStore.qml +++ b/ui/imports/shared/stores/RootStore.qml @@ -22,10 +22,6 @@ QtObject { localAccountSensitiveSettings.neverAskAboutUnfurlingAgain = value; } - function setGifUnfurlingEnabled(value) { - localAccountSensitiveSettings.gifUnfurlingEnabled = value - } - function getPasswordStrengthScore(password) { return root.privacyModule.getPasswordStrengthScore(password); }