Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#37): stop fetching verified account if the api is offline #39

Merged
merged 1 commit into from
Jan 16, 2024
Merged
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,6 @@
"outputDirectory": "coverage",
"outputName": "jest-sonar-report.xml",
"relativePaths": true
}
},
"packageManager": "yarn@1.22.21"
}
5 changes: 0 additions & 5 deletions res/css/superhero/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ h2 .sh_VerifiedIcon {
mask-image: url("../../themes/superhero/img/icons/diamond.svg");
}

.mx_QuickSettingsButton.sh_MintTokenButton::before {
-webkit-mask-image: url("../../themes/superhero/img/icons/tokens.svg");
mask-image: url("../../themes/superhero/img/icons/tokens.svg");
}

/* START - Update @user chat message highlighting */
.mx_EventTile.mx_EventTile_highlight,
.mx_EventTile.mx_EventTile_highlight .markdown-body,
Expand Down
5 changes: 0 additions & 5 deletions res/themes/superhero/img/icons/tokens.svg

This file was deleted.

21 changes: 11 additions & 10 deletions src/components/views/dialogs/spotlight/SpotlightDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,15 @@ const findVisibleRoomMembers = (visibleRooms: Room[], cli: MatrixClient, filterD
return Object.values(
visibleRooms
.filter((room) => !filterDMs || !DMRoomMap.shared().getUserIdForRoomId(room.roomId))
.reduce((members, room) => {
for (const member of room.getJoinedMembers()) {
members[member.userId] = member;
}
return members;
}, {} as Record<string, RoomMember>),
.reduce(
(members, room) => {
for (const member of room.getJoinedMembers()) {
members[member.userId] = member;
}
return members;
},
{} as Record<string, RoomMember>,
),
).filter((it) => it.userId !== cli.getUserId());
};

Expand Down Expand Up @@ -630,8 +633,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
{...ariaProperties}
>
<DecoratedRoomAvatar room={result.room} size={AVATAR_SIZE} tooltipProps={{ tabIndex: -1 }} />
<RoomName room={result.room} /> {' '}
<NotificationBadge notification={notification} />
<RoomName room={result.room} /> <NotificationBadge notification={notification} />
<RoomContextDetails
id={`mx_SpotlightDialog_button_result_${result.room.roomId}_details`}
className="mx_SpotlightDialog_result_details"
Expand Down Expand Up @@ -1071,8 +1073,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
size={AVATAR_SIZE}
tooltipProps={{ tabIndex: -1 }}
/>
<RoomName room={room} /> {' '}
<NotificationBadge notification={notification} />
<RoomName room={room} /> <NotificationBadge notification={notification} />
<RoomContextDetails
id={`mx_SpotlightDialog_button_recentSearch_${room.roomId}_details`}
className="mx_SpotlightDialog_result_details"
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/elements/RoomName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const RoomName = ({ room, children, maxLength }: IProps): JSX.Element =>
{isCommunityRoom && <CommunityRoomIcon className="sh_RoomTokenGatedRoomIcon" />}
{isTokenGatedRoom && <TokenGatedRoomIcon className="sh_RoomTokenGatedRoomIcon" />}
<span dir="auto">{truncatedRoomName}</span>
{(roomUsers?.length && !isTokenGatedRoom && !isCommunityRoom) ? (
{roomUsers?.length && !isTokenGatedRoom && !isCommunityRoom ? (
<UserVerifiedBadge userId={roomUsers[0]} />
) : null}
</span>
Expand Down
12 changes: 6 additions & 6 deletions src/components/views/right_panel/UserInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,8 @@ export const RoomKickButton = ({
? _t("user_info|disinvite_button_space")
: _t("user_info|kick_button_space")
: member.membership === "invite"
? _t("user_info|disinvite_button_room")
: _t("user_info|kick_button_room"),
? _t("user_info|disinvite_button_room")
: _t("user_info|kick_button_room"),
title:
member.membership === "invite"
? _t("user_info|disinvite_button_room_name", { roomName: room.name })
Expand Down Expand Up @@ -723,8 +723,8 @@ export const RoomKickButton = ({
? _t("user_info|disinvite_button_space")
: _t("user_info|kick_button_space")
: member.membership === "invite"
? _t("user_info|disinvite_button_room")
: _t("user_info|kick_button_room");
? _t("user_info|disinvite_button_room")
: _t("user_info|kick_button_room");

return (
<AccessibleButton
Expand Down Expand Up @@ -784,8 +784,8 @@ export const BanToggleButton = ({
? _t("user_info|unban_button_space")
: _t("user_info|ban_button_space")
: isBanned
? _t("user_info|unban_button_room")
: _t("user_info|ban_button_room"),
? _t("user_info|unban_button_room")
: _t("user_info|ban_button_room"),
title: isBanned
? _t("user_info|unban_room_confirm_title", { roomName: room.name })
: _t("user_info|ban_room_confirm_title", { roomName: room.name }),
Expand Down
3 changes: 1 addition & 2 deletions src/components/views/rooms/RoomTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -479,12 +479,11 @@ export class RoomTile extends React.PureComponent<ClassProps, State> {
return (
<React.Fragment>
<RovingTabIndexWrapper inputRef={this.roomTileRef}>
{({ onFocus, isActive, ref }): ReactElement => (
{({ onFocus, isActive }): ReactElement<any, any> => (
<Button
{...props}
onFocus={onFocus}
tabIndex={isActive ? 0 : -1}
inputRef={ref}
className={classes}
onClick={this.onTileClick}
onContextMenu={this.onContextMenu}
Expand Down
33 changes: 0 additions & 33 deletions src/components/views/spaces/MintTokenButton.tsx

This file was deleted.

5 changes: 4 additions & 1 deletion src/context/SuperheroProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export const SuperheroProvider = ({ children, config }: any): any => {
method: "POST",
})
.then((res) => res.json())
.then(setVerifiedAccounts);
.then(setVerifiedAccounts)
.catch(() => {
//
});
}
}

Expand Down