1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-04 12:52:06 -04:00

plugins: add plugin state helpers

This commit is contained in:
bbedward
2026-02-12 14:04:56 -05:00
parent ba5bf0cabc
commit 0e9b21d359
5 changed files with 592 additions and 0 deletions

View File

@@ -147,6 +147,24 @@ Item {
return defaultValue;
}
function saveState(key, value) {
if (!pluginService)
return;
if (pluginService.savePluginState)
pluginService.savePluginState(pluginId, key, value);
}
function loadState(key, defaultValue) {
if (pluginService && pluginService.loadPluginState)
return pluginService.loadPluginState(pluginId, key, defaultValue);
return defaultValue;
}
function clearState() {
if (pluginService && pluginService.clearPluginState)
pluginService.clearPluginState(pluginId);
}
function findFlickable(item) {
var current = item?.parent;
while (current) {