This commit is contained in:
shin 2026-08-13 19:06:56 +03:00 • committed by GitHub
parent 53a913f865
commit 4ffc72c97d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -48,12 +48,17 @@ export default function patchYouBarButtons(): () => void {
const cleanups: (() => void)[] = []; const cleanups: (() => void)[] = [];
patchCreateElement(cleanups); patchCreateElement(cleanups);
// Matches the notification button reliably even if Discord localizes or changes accessibilityLabel // Matches the notification button reliably even if Discord localizes or changes accessibilityLabel,
// safely guarding BellIcon so undefined doesn't match iconless props.
registerPropsTransform( registerPropsTransform(
(props) => { (props) => {
if (!storage.showInboxButton) return false; if (!storage.showInboxButton) return false;
const label = props?.accessibilityLabel?.toLowerCase(); const label = props?.accessibilityLabel?.toLowerCase();
return label === "notifications" || label === "inbox" || props?.icon === BellIcon; return (
label === "notifications" ||
label === "inbox" ||
(BellIcon != null && props?.icon === BellIcon)
);
}, },
(props) => ({ (props) => ({
...props, ...props,