From 9c4c4dcc6afe64437b812bb28e7a1a60d3cd8d4b Mon Sep 17 00:00:00 2001 From: James Jen Date: Thu, 31 Jul 2025 14:19:55 -0700 Subject: [PATCH 1/4] 'recents' initiated to [] which is truthy. '\!recents' will always be false. Intent of the code is to kick off warning if the 'recents' array is empty, whichh recents.length === 0 tests for --- src/components/views/dialogs/InviteDialog.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/dialogs/InviteDialog.tsx b/src/components/views/dialogs/InviteDialog.tsx index 62536acfd69..acb8f9b471f 100644 --- a/src/components/views/dialogs/InviteDialog.tsx +++ b/src/components/views/dialogs/InviteDialog.tsx @@ -487,7 +487,7 @@ export default class InviteDialog extends React.PureComponent b.lastActive - a.lastActive); From 06cf56acbc09015e7754ed735699ccc86a2f57d4 Mon Sep 17 00:00:00 2001 From: James Jen Date: Thu, 31 Jul 2025 14:21:48 -0700 Subject: [PATCH 2/4] Removed dead code. Since all possiblities of isTimelineA and isTimelineB is covered, the return 0 will never be reached --- src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx b/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx index 2837701673e..4c5e4f2b4b2 100644 --- a/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx +++ b/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx @@ -95,8 +95,6 @@ export default class WidgetCapabilitiesPromptDialog extends React.PureComponent< if (isTimelineA && !isTimelineB) return 1; if (!isTimelineA && isTimelineB) return -1; if (isTimelineA && isTimelineB) return lexicographicCompare(capA, capB); - - return 0; }); const checkboxRows = orderedCapabilities.map(([cap, isChecked], i) => { const text = CapabilityText.for(cap, this.props.widgetKind); From fd6ed60bb8a136027818256c2525e71e0283df9f Mon Sep 17 00:00:00 2001 From: James Jen Date: Thu, 31 Jul 2025 14:24:32 -0700 Subject: [PATCH 3/4] Fixed copy/paste error. If clause checks for 'allowed' being of type array before array command. --- src/utils/permalinks/Permalinks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/permalinks/Permalinks.ts b/src/utils/permalinks/Permalinks.ts index 0df4b4beb12..5c5e0b271ac 100644 --- a/src/utils/permalinks/Permalinks.ts +++ b/src/utils/permalinks/Permalinks.ts @@ -217,7 +217,7 @@ export class RoomPermalinkCreator { const allowed = aclEvent.getContent<{ allow: string[] }>().allow; allowedHostsRegexps = []; // we don't want to use the default rule here - if (Array.isArray(denied)) { + if (Array.isArray(allowed)) { allowed.forEach((h) => allowedHostsRegexps.push(getRegex(h))); } } From bbacbb473d268d4bfd558ec49dbd0c8c9b24cab5 Mon Sep 17 00:00:00 2001 From: James Jen Date: Thu, 31 Jul 2025 14:28:51 -0700 Subject: [PATCH 4/4] Removed dead code. '\!filter' returns a boolean which will never eual to null. This condition will always be true. --- src/components/views/dialogs/spotlight/SpotlightDialog.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/views/dialogs/spotlight/SpotlightDialog.tsx b/src/components/views/dialogs/spotlight/SpotlightDialog.tsx index 419a12df896..f00758a8011 100644 --- a/src/components/views/dialogs/spotlight/SpotlightDialog.tsx +++ b/src/components/views/dialogs/spotlight/SpotlightDialog.tsx @@ -1164,7 +1164,6 @@ const SpotlightDialog: React.FC = ({ initialText = "", initialFilter = n // only handle these keys when we are in the recently viewed row of options if ( !query && - !filter !== null && rovingContext.state.activeNode && rovingContext.state.nodes.length > 0 && nodeIsForRecentlyViewed(rovingContext.state.activeNode)