room url copy button for ics

This commit is contained in:
Igor Loskutov
2025-09-16 16:52:12 -04:00
parent 88fe0e051d
commit f4d59a4af8
5 changed files with 101 additions and 14 deletions

View File

@@ -33,6 +33,7 @@ import { RoomList } from "./_components/RoomList";
import { PaginationPage } from "../browse/_components/Pagination";
import { assertExists } from "../../lib/utils";
import ICSSettings from "./_components/ICSSettings";
import { roomAbsoluteUrl } from "../../lib/routesClient";
type Room = components["schemas"]["Room"];
@@ -187,13 +188,12 @@ export default function RoomsList() {
});
const handleCopyUrl = (roomName: string) => {
const roomUrl = `${window.location.origin}/${roomName}`;
navigator.clipboard.writeText(roomUrl);
setLinkCopied(roomName);
setTimeout(() => {
setLinkCopied("");
}, 2000);
navigator.clipboard.writeText(roomAbsoluteUrl(roomName)).then(() => {
setLinkCopied(roomName);
setTimeout(() => {
setLinkCopied("");
}, 2000);
});
};
const handleCloseDialog = () => {
@@ -620,7 +620,6 @@ export default function RoomsList() {
<Tabs.Content value="calendar" pt={6}>
<ICSSettings
roomId={editRoomId ?? undefined}
roomName={room.name}
icsUrl={room.icsUrl}
icsEnabled={room.icsEnabled}