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

View File

@ -206,7 +206,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

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