Merge pull request #21 from archem-team/bug/invite_url_default

Changed to back
pull/1154/head
teamabron 2025-01-20 21:40:59 +03:30 committed by GitHub
commit 5ffde04492
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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}`
),
},
]}
/>
);
}