pull/1154/head
TeamAbronDev 2025-01-25 17:10:16 +03:30
parent be8bb87ce7
commit e0a2e97b33
1 changed files with 5 additions and 7 deletions

View File

@ -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({
) : (
<Invite>
<Text id="app.special.modals.prompt.create_invite_created" />
<code style="font-size:14px">https://{window.location.host}/invite/{code}</code>
<code>{code}</code>
</Invite>
),
},
@ -81,10 +79,10 @@ export default function CreateInvite({
children: <Text id="app.context_menu.copy_link" />,
onClick: () =>
modalController.writeText(
`https://${window.location.host}/invite/${code}`,
IS_REVOLT ? `https://rvlt.gg/${code}` : `${window.location.host}/invite/${code}`
),
},
]}
/>
);
}
}