mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-17 16:57:50 +00:00
wait for unlock before showing toasts
This commit is contained in:
@@ -211,6 +211,7 @@ class PluginLoader extends Logger {
|
|||||||
this.deckyState.setHasLoaderUpdate(true);
|
this.deckyState.setHasLoaderUpdate(true);
|
||||||
if (this.notificationService.shouldNotify('deckyUpdates')) {
|
if (this.notificationService.shouldNotify('deckyUpdates')) {
|
||||||
this.loaderUpdateToast && this.loaderUpdateToast.dismiss();
|
this.loaderUpdateToast && this.loaderUpdateToast.dismiss();
|
||||||
|
await this.routerHook.waitForUnlock();
|
||||||
this.loaderUpdateToast = this.toaster.toast({
|
this.loaderUpdateToast = this.toaster.toast({
|
||||||
title: <TranslationHelper transClass={TranslationClass.PLUGIN_LOADER} transText="decky_title" />,
|
title: <TranslationHelper transClass={TranslationClass.PLUGIN_LOADER} transText="decky_title" />,
|
||||||
body: (
|
body: (
|
||||||
|
|||||||
@@ -173,10 +173,9 @@ class RouterHook extends Logger {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async waitForUnlock() {
|
public async waitForUnlock() {
|
||||||
try {
|
try {
|
||||||
while (window?.securitystore?.IsLockScreenActive?.()) {
|
while (window?.securitystore?.IsLockScreenActive?.()) {
|
||||||
this.debug('Waiting 500ms for lockscreen to close');
|
|
||||||
await sleep(500);
|
await sleep(500);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user