Changed to back

pull/1075/head
ramin 2025-01-20 21:39:02 +03:30
parent 7f9f2ab566
commit 31f0c282de
1 changed files with 4 additions and 5 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) }),
)
@ -81,10 +79,11 @@ export default function CreateInvite({
children: <Text id="app.context_menu.copy_link" />,
onClick: () =>
modalController.writeText(
`https://${window.location.host}/invite/${code}`,
`https://${window.location.host}/invite/${code}`
),
},
]}
/>
);
}