1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-02 03:28:28 -04:00

dankbar: fix widget registration during visibility changes

fixes #1956
This commit is contained in:
bbedward
2026-07-02 15:07:43 -04:00
parent db3615805c
commit 70fa0ec903
16 changed files with 40 additions and 8 deletions
+3 -1
View File
@@ -27,13 +27,15 @@ Singleton {
widgetRegistered(widgetId, screenName);
}
function unregisterWidget(widgetId, screenName) {
function unregisterWidget(widgetId, screenName, widgetRef) {
if (!widgetId || !screenName)
return;
if (typeof widgetRegistry !== "object" || widgetRegistry === null)
return;
if (!widgetRegistry[widgetId])
return;
if (widgetRef && widgetRegistry[widgetId][screenName] !== widgetRef)
return;
const nextRegistry = Object.assign({}, widgetRegistry);
const screenMap = (typeof nextRegistry[widgetId] === "object" && nextRegistry[widgetId] !== null) ? Object.assign({}, nextRegistry[widgetId]) : {};