Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/views/dialogs/InviteDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
// We mutate the given set so that any later callers avoid duplicating these users
excludedTargetIds.add(userId);
}
if (!recents) logger.warn("[Invite:Recents] No recents to suggest!");
if (recents.length === 0) logger.warn("[Invite:Recents] No recents to suggest!");

// Sort the recents by last active to save us time later
recents.sort((a, b) => b.lastActive - a.lastActive);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,6 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
// only handle these keys when we are in the recently viewed row of options
if (
!query &&
!filter !== null &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest seem fine but I assume there was some intention here even if it got typo-ed. It seems to me like it's supposed to just not have the negation on filter, ie. just be filter !== null which is a pattern that crops up plenty of other times. It would probably be worth trying the tests & functionality with this rather than just blindly removing the line. Also, the same thing appears on line 1147, so let's be consistent.

rovingContext.state.activeNode &&
rovingContext.state.nodes.length > 0 &&
nodeIsForRecentlyViewed(rovingContext.state.activeNode)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/permalinks/Permalinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}
}
Expand Down
Loading