diff --git a/src/controllers/modals/components/CreateInvite.tsx b/src/controllers/modals/components/CreateInvite.tsx
index 4fb7abe0..e52e4cab 100644
--- a/src/controllers/modals/components/CreateInvite.tsx
+++ b/src/controllers/modals/components/CreateInvite.tsx
@@ -7,10 +7,10 @@ import { ModalForm } from "@revoltchat/ui";
import { noopAsync } from "../../../lib/js";
-import { IS_REVOLT } from "../../../version";
import { takeError } from "../../client/jsx/error";
import { modalController } from "../ModalController";
import { ModalProps } from "../types";
+import { IS_REVOLT } from "../../../version";
/**
* Code block which displays invite
@@ -44,9 +44,7 @@ export default function CreateInvite({
target
.createInvite()
- .then((res) => {
- setCode(res._id || "default_code");
- })
+ .then(({ _id }) => setCode(_id))
.catch((err) =>
modalController.push({ type: "error", error: takeError(err) }),
)
@@ -67,7 +65,7 @@ export default function CreateInvite({
) : (
- https://{window.location.host}/invite/{code}
+ {code}
),
},
@@ -81,10 +79,10 @@ export default function CreateInvite({
children: ,
onClick: () =>
modalController.writeText(
- `https://${window.location.host}/invite/${code}`,
+ IS_REVOLT ? `https://rvlt.gg/${code}` : `${window.location.host}/invite/${code}`
),
},
]}
/>
);
-}
+}
\ No newline at end of file