mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-11 14:59:38 -04:00
fix(ipc): dash and dankdash commands work without clock widget (#2392)
getPreferredBar("clockButtonRef") returns null when the clock widget
is removed from the bar. Fall back to getPreferredBar() (any bar) so
triggerDashTab can still open the popout with default positioning.
This commit is contained in:
@@ -176,7 +176,7 @@ Item {
|
||||
}
|
||||
|
||||
function open(tab: string): string {
|
||||
const bar = root.getPreferredBar("clockButtonRef");
|
||||
const bar = root.getPreferredBar("clockButtonRef") || root.getPreferredBar();
|
||||
if (!bar)
|
||||
return "DASH_OPEN_FAILED";
|
||||
|
||||
@@ -209,7 +209,7 @@ Item {
|
||||
return "DASH_TOGGLE_SUCCESS";
|
||||
}
|
||||
|
||||
const bar = root.getPreferredBar("clockButtonRef");
|
||||
const bar = root.getPreferredBar("clockButtonRef") || root.getPreferredBar();
|
||||
if (bar) {
|
||||
if (!bar.triggerDashTab(resolveTabIndex(tab)))
|
||||
return "DASH_TOGGLE_FAILED";
|
||||
@@ -582,7 +582,7 @@ Item {
|
||||
|
||||
IpcHandler {
|
||||
function wallpaper(): string {
|
||||
const bar = root.getPreferredBar("clockButtonRef");
|
||||
const bar = root.getPreferredBar("clockButtonRef") || root.getPreferredBar();
|
||||
if (bar) {
|
||||
bar.triggerWallpaperBrowser();
|
||||
return "SUCCESS: Toggled wallpaper browser";
|
||||
|
||||
Reference in New Issue
Block a user