.
This commit is contained in:
parent
53a913f865
commit
4ffc72c97d
1 changed files with 7 additions and 2 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue