diff options
| author | AAGaming <aagaming@riseup.net> | 2024-07-26 14:53:41 -0400 |
|---|---|---|
| committer | AAGaming <aagaming@riseup.net> | 2024-08-03 14:04:19 -0400 |
| commit | c2443ee2c5427504fb30b77a86dfd700f2b126f4 (patch) | |
| tree | 5c2536adce5a484a20a132d6a553bca6ca51e125 | |
| parent | df52ebe7edeb88dcdf7d7ee7cb64deaa7abdb66f (diff) | |
| download | decky-loader-c2443ee2c5427504fb30b77a86dfd700f2b126f4.tar.gz decky-loader-c2443ee2c5427504fb30b77a86dfd700f2b126f4.zip | |
fix(toaster): remove critical toast logic as ProcessNotification handles it for us
| -rw-r--r-- | frontend/src/tabs-hook.tsx | 2 | ||||
| -rw-r--r-- | frontend/src/toaster.tsx | 38 |
2 files changed, 15 insertions, 25 deletions
diff --git a/frontend/src/tabs-hook.tsx b/frontend/src/tabs-hook.tsx index 34b5f592..41bfad1a 100644 --- a/frontend/src/tabs-hook.tsx +++ b/frontend/src/tabs-hook.tsx @@ -49,7 +49,6 @@ class TabsHook extends Logger { const patchHandler = createReactTreePatcher( [(tree) => findInReactTree(tree, (node) => node?.props?.onFocusNavDeactivated)], (args, ret) => { - this.log('qam render', args, ret); const tabs = findInReactTree(ret, (x) => x?.props?.tabs); this.render(tabs.props.tabs, args[0].visible); return ret; @@ -63,7 +62,6 @@ class TabsHook extends Logger { const root = getReactRoot(document.getElementById('root') as any); const qamNode = root && findInReactTree(root, (n: any) => n.elementType == qamRenderer); // need elementType, because type is actually mobx wrapper if (qamNode) { - this.debug('qamNode', qamNode); // Only affects this fiber node so we don't need to unpatch here qamNode.type = qamNode.elementType.type; if (qamNode?.alternate) { diff --git a/frontend/src/toaster.tsx b/frontend/src/toaster.tsx index b6b29157..06150b9e 100644 --- a/frontend/src/toaster.tsx +++ b/frontend/src/toaster.tsx @@ -67,31 +67,23 @@ class Toaster extends Logger { if (toast.playSound === undefined) toast.playSound = true; if (toast.showToast === undefined) toast.showToast = true; if (toast.timestamp === undefined) toast.timestamp = new Date(); - if ( - (window.settingsStore.settings.bDisableAllToasts && !toast.critical) || - (window.settingsStore.settings.bDisableToastsInGame && - !toast.critical && - window.NotificationStore.BIsUserInGame()) - ) - return; - if (toast.showToast) { - function fnTray(toast: any, tray: any) { - let group = { - eType: toast.eType, - notifications: [toast], - }; - tray.unshift(group); - // TODO do we need to handle expiration? - } - const info = { - showToast: toast.showToast, - sound: toast.sound, - eFeature: 0, - toastDurationMS: toastData.nToastDurationMS, - fnTray, + function fnTray(toast: any, tray: any) { + let group = { + eType: toast.eType, + notifications: [toast], }; - window.NotificationStore.ProcessNotification(info, toastData, ToastType.New); + tray.unshift(group); + // TODO do we need to handle expiration? how do we do that? } + const info = { + showToast: toast.showToast, + sound: toast.sound, + eFeature: 0, + toastDurationMS: toastData.nToastDurationMS, + bCritical: toast.critical, + fnTray, + }; + window.NotificationStore.ProcessNotification(info, toastData, ToastType.New); } deinit() { |
