mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-10 01:03:36 -05:00
reindent
This commit is contained in:
parent
0b0d1186eb
commit
f9bb332605
2 changed files with 34 additions and 34 deletions
|
@ -158,20 +158,20 @@ const Message = observer(
|
|||
isInvite = true;
|
||||
}
|
||||
})
|
||||
if (isInvite) {
|
||||
const inviteRegex = new RegExp("(?:" + INVITE_PATHS.map((path, index) => path.split(".").join("\\.") + (index !== INVITE_PATHS.length - 1 ? "|" : "")).join("") + ")/([A-Za-z0-9]*)", "g");
|
||||
if (inviteRegex.test(content)) {
|
||||
let results: string[] = [];
|
||||
let match: RegExpExecArray | null;
|
||||
inviteRegex.lastIndex = 0;
|
||||
while ((match = inviteRegex.exec(content)) !== null) {
|
||||
if (!results.includes(match[match.length - 1])) {
|
||||
results.push(match[match.length - 1]);
|
||||
}
|
||||
}
|
||||
return results.map(code => <EmbedInvite code={code} />);
|
||||
}
|
||||
}
|
||||
if (isInvite) {
|
||||
const inviteRegex = new RegExp("(?:" + INVITE_PATHS.map((path, index) => path.split(".").join("\\.") + (index !== INVITE_PATHS.length - 1 ? "|" : "")).join("") + ")/([A-Za-z0-9]*)", "g");
|
||||
if (inviteRegex.test(content)) {
|
||||
let results: string[] = [];
|
||||
let match: RegExpExecArray | null;
|
||||
inviteRegex.lastIndex = 0;
|
||||
while ((match = inviteRegex.exec(content)) !== null) {
|
||||
if (!results.includes(match[match.length - 1])) {
|
||||
results.push(match[match.length - 1]);
|
||||
}
|
||||
}
|
||||
return results.map(code => <EmbedInvite code={code} />);
|
||||
}
|
||||
}
|
||||
})()}
|
||||
{queued?.error && (
|
||||
<Overline type="error" error={queued.error} />
|
||||
|
|
|
@ -74,29 +74,29 @@ export default function EmbedInvite(props: Props) {
|
|||
}, [client, code, invite, status]);
|
||||
|
||||
if (typeof invite === "undefined") {
|
||||
return <EmbedInviteBase>
|
||||
{error ? (
|
||||
<Overline type="error" error={error} />
|
||||
) : (
|
||||
<Preloader type="ring" />
|
||||
)}
|
||||
</EmbedInviteBase>
|
||||
return <EmbedInviteBase>
|
||||
{error ? (
|
||||
<Overline type="error" error={error} />
|
||||
) : (
|
||||
<Preloader type="ring" />
|
||||
)}
|
||||
</EmbedInviteBase>
|
||||
}
|
||||
|
||||
return <EmbedInviteBase>
|
||||
|
||||
return <EmbedInviteBase>
|
||||
<ServerIcon
|
||||
attachment={invite.server_icon}
|
||||
server_name={invite.server_name}
|
||||
size={55}
|
||||
/>
|
||||
<EmbedInviteDetails>
|
||||
<EmbedInviteName>
|
||||
{invite.server_name}
|
||||
</EmbedInviteName>
|
||||
<EmbedInviteMemberCount>
|
||||
{invite.member_count} members
|
||||
</EmbedInviteMemberCount>
|
||||
</EmbedInviteDetails>
|
||||
<EmbedInviteDetails>
|
||||
<EmbedInviteName>
|
||||
{invite.server_name}
|
||||
</EmbedInviteName>
|
||||
<EmbedInviteMemberCount>
|
||||
{invite.member_count} members
|
||||
</EmbedInviteMemberCount>
|
||||
</EmbedInviteDetails>
|
||||
<Button onClick={async () => {
|
||||
try {
|
||||
setProcessing(true);
|
||||
|
@ -139,7 +139,7 @@ export default function EmbedInvite(props: Props) {
|
|||
setProcessing(false);
|
||||
}
|
||||
}}>
|
||||
{client.servers.get(invite.server_id) ? "Joined" : "Join"}
|
||||
</Button>
|
||||
</EmbedInviteBase>
|
||||
{client.servers.get(invite.server_id) ? "Joined" : "Join"}
|
||||
</Button>
|
||||
</EmbedInviteBase>
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue