mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
fix: shorter than 6 character invite codes
Fixes ZDEV-108
This commit is contained in:
parent
008ac1bec0
commit
2ce5082018
1 changed files with 4 additions and 3 deletions
|
@ -557,11 +557,12 @@ export function getUrlsInString(str: string, onlyUnique = false): MatchedURL[] {
|
|||
}
|
||||
|
||||
export function parseInviteCodeInput(str: string): string {
|
||||
if (str.match(/^[a-z0-9]{6,}$/i)) {
|
||||
return str;
|
||||
const parsedInviteCodes = getInviteCodesInString(str);
|
||||
if (parsedInviteCodes.length) {
|
||||
return parsedInviteCodes[0];
|
||||
}
|
||||
|
||||
return getInviteCodesInString(str)[0];
|
||||
return str;
|
||||
}
|
||||
|
||||
export function isNotNull<T>(value: T): value is Exclude<T, null | undefined> {
|
||||
|
|
Loading…
Add table
Reference in a new issue