1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-11 16:22:09 -04:00

launcher v2: add visibility guards

This commit is contained in:
bbedward
2026-02-10 17:40:41 -05:00
parent 081b15e24c
commit 1cdec5d687
3 changed files with 13 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ Singleton {
id: root id: root
property var appUsageRanking: {} property var appUsageRanking: {}
property bool _saving: false
Component.onCompleted: { Component.onCompleted: {
loadSettings(); loadSettings();
@@ -59,7 +60,9 @@ Singleton {
} }
appUsageRanking = currentRanking; appUsageRanking = currentRanking;
_saving = true;
saveSettings(); saveSettings();
_saving = false;
} }
function getRankedApps() { function getRankedApps() {
@@ -97,7 +100,9 @@ Singleton {
if (hasChanges) { if (hasChanges) {
appUsageRanking = currentRanking; appUsageRanking = currentRanking;
_saving = true;
saveSettings(); saveSettings();
_saving = false;
} }
} }
@@ -109,6 +114,8 @@ Singleton {
blockWrites: true blockWrites: true
watchChanges: true watchChanges: true
onLoaded: { onLoaded: {
if (root._saving)
return;
parseSettings(settingsFile.text()); parseSettings(settingsFile.text());
} }
onLoadFailed: error => {} onLoadFailed: error => {}

View File

@@ -26,6 +26,7 @@ Item {
property string activePluginId: "" property string activePluginId: ""
property var collapsedSections: ({}) property var collapsedSections: ({})
property bool keyboardNavigationActive: false property bool keyboardNavigationActive: false
property bool active: false
property var _modeSectionsCache: ({}) property var _modeSectionsCache: ({})
property bool _queryDrivenSearch: false property bool _queryDrivenSearch: false
property bool _diskCacheConsumed: false property bool _diskCacheConsumed: false
@@ -52,6 +53,8 @@ Item {
Connections { Connections {
target: AppSearchService target: AppSearchService
function onCacheVersionChanged() { function onCacheVersionChanged() {
if (!active)
return;
_clearModeCache(); _clearModeCache();
if (!searchQuery && searchMode === "all") if (!searchQuery && searchMode === "all")
performSearch(); performSearch();
@@ -61,6 +64,8 @@ Item {
Connections { Connections {
target: PluginService target: PluginService
function onRequestLauncherUpdate(pluginId) { function onRequestLauncherUpdate(pluginId) {
if (!active)
return;
if (activePluginId === pluginId) { if (activePluginId === pluginId) {
if (activePluginCategories.length <= 1) if (activePluginCategories.length <= 1)
loadPluginCategories(pluginId); loadPluginCategories(pluginId);

View File

@@ -86,6 +86,7 @@ FocusScope {
Controller { Controller {
id: controller id: controller
active: root.parentModal?.spotlightOpen ?? true
viewModeContext: root.viewModeContext viewModeContext: root.viewModeContext
onItemExecuted: { onItemExecuted: {