mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 12:42:01 +00:00
hopefully actually fix toaster
This commit is contained in:
@@ -68,7 +68,7 @@ class Toaster extends Logger {
|
|||||||
this.settingsModule = findModuleChild((m) => {
|
this.settingsModule = findModuleChild((m) => {
|
||||||
if (typeof m !== 'object') return undefined;
|
if (typeof m !== 'object') return undefined;
|
||||||
for (let prop in m) {
|
for (let prop in m) {
|
||||||
if (typeof m[prop]?.settings?.bDisableToastsInGame !== 'undefined') return m[prop];
|
if (typeof m[prop]?.settings && m[prop]?.communityPreferences) return m[prop];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.log('Initialized');
|
this.log('Initialized');
|
||||||
@@ -79,7 +79,7 @@ class Toaster extends Logger {
|
|||||||
while (!this.ready) {
|
while (!this.ready) {
|
||||||
await sleep(100);
|
await sleep(100);
|
||||||
}
|
}
|
||||||
const settings = this.settingsModule.settings;
|
const settings = this.settingsModule?.settings;
|
||||||
let toastData = {
|
let toastData = {
|
||||||
nNotificationID: window.NotificationStore.m_nNextTestNotificationID++,
|
nNotificationID: window.NotificationStore.m_nNextTestNotificationID++,
|
||||||
rtCreated: Date.now(),
|
rtCreated: Date.now(),
|
||||||
@@ -91,8 +91,8 @@ class Toaster extends Logger {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
toastData.data.appid = () => 0;
|
toastData.data.appid = () => 0;
|
||||||
if (
|
if (
|
||||||
(settings.bDisableAllToasts && !toast.critical) ||
|
(settings?.bDisableAllToasts && !toast.critical) ||
|
||||||
(settings.bDisableToastsInGame && !toast.critical && window.NotificationStore.BIsUserInGame())
|
(settings?.bDisableToastsInGame && !toast.critical && window.NotificationStore.BIsUserInGame())
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
window.NotificationStore.m_rgNotificationToasts.push(toastData);
|
window.NotificationStore.m_rgNotificationToasts.push(toastData);
|
||||||
|
|||||||
Reference in New Issue
Block a user