Files
discord-decomp/records/LinkRecord.tsx
T
2026-11-01 12:12:55 +02:00

41 lines
1.2 KiB
TypeScript

// Metro module 6166 (f6167).
import Record from "../lib/Record";
import { Routes } from "../Constants";
import { $callWithNewTarget } from "../_hermes/prelude";
class LinkRecord extends Record {
constructor(a0) {
super();
this.id = a0.id;
this.path = a0.path;
this.inviteCode = a0.inviteCode;
}
static fromPath(a0) {
const r1 = {
id: a0,
path: a0
};
const prototypeOf = Object.getPrototypeOf(LinkRecord);
const r10 = Object.create(LinkRecord.prototype);
const r11 = $callWithNewTarget(prototypeOf, r10, LinkRecord);
const r12 = r11 instanceof Object ? r11 : r10;
r12.id = r1.id;
r12.path = r1.path;
r12.inviteCode = r1.inviteCode;
return r12;
}
static fromInviteCode(a0) {
const id = `invite:${a0}`;
const path = Routes.INVITE(a0);
const prototypeOf = Object.getPrototypeOf(LinkRecord);
const r17 = Object.create(LinkRecord.prototype);
const r18 = $callWithNewTarget(prototypeOf, r17, LinkRecord);
const r19 = r18 instanceof Object ? r18 : r17;
r19.id = id;
r19.path = path;
r19.inviteCode = a0;
return r19;
}
}
export default LinkRecord;
export { LinkRecord };