Remove contact resolver id check (#2910)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2023-04-06 12:48:56 +06:00 committed by GitHub
parent 6e10f571ad
commit b068478d83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,19 +181,13 @@ export async function getContactLink (doc: Doc): Promise<Location> {
return loc
}
function isId (id: Ref<Contact>): boolean {
return /^[0-9a-z]{24}$/.test(id)
}
export async function resolveLocation (loc: Location): Promise<ResolvedLocation | undefined> {
if (loc.path[2] !== contactId) {
return undefined
}
const id = loc.path[3] as Ref<Contact>
if (isId(id)) {
return await generateLocation(loc, id)
}
return await generateLocation(loc, id)
}
async function generateLocation (loc: Location, id: Ref<Contact>): Promise<ResolvedLocation | undefined> {