Jonathan Rainville a6adb9eddb
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.
2024-10-25 14:12:37 -04:00

53 lines
1.5 KiB
QML

import QtQuick 2.15
QtObject {
readonly property QtObject _d: QtObject {
id: d
readonly property var gifsModuleInst: typeof gifsModule !== "undefined"
? gifsModule : null
}
property var gifColumnA: d.gifsModuleInst ? d.gifsModuleInst.gifColumnA : null
property var gifColumnB: d.gifsModuleInst ? d.gifsModuleInst.gifColumnB : null
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)
}
function getTrendingsGifs() {
if (d.gifsModuleInst)
d.gifsModuleInst.getTrendingsGifs()
}
function getRecentsGifs() {
if (d.gifsModuleInst)
d.gifsModuleInst.getRecentsGifs()
}
function getFavoritesGifs() {
return d.gifsModuleInst ? d.gifsModuleInst.getFavoritesGifs() : null
}
function isFavorite(id) {
return d.gifsModuleInst ? d.gifsModuleInst.isFavorite(id) : null
}
function toggleFavoriteGif(id, reload) {
if (d.gifsModuleInst)
d.gifsModuleInst.toggleFavoriteGif(id, reload)
}
function addToRecentsGif(id) {
if (d.gifsModuleInst)
d.gifsModuleInst.addToRecentsGif(id)
}
}