fix(gifs): fix call to setGifUnfurlingEnabled using a bad store (#16603)

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.
This commit is contained in:
Jonathan Rainville 2024-10-25 10:54:58 -04:00 committed by GitHub
parent 3793405843
commit 9e5a172632
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -205,7 +205,7 @@ Popup {
visible: true
onEnableGifsRequested: {
RootStore.setGifUnfurlingEnabled(true)
root.gifStore.setGifUnfurlingEnabled(true)
root.gifStore.getTrendingsGifs()
}
}

View File

@ -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)

View File

@ -24,10 +24,6 @@ QtObject {
localAccountSensitiveSettings.neverAskAboutUnfurlingAgain = value;
}
function setGifUnfurlingEnabled(value) {
localAccountSensitiveSettings.gifUnfurlingEnabled = value
}
function getPasswordStrengthScore(password) {
return root.privacyModule.getPasswordStrengthScore(password);
}