mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-28 04:49:21 +02:00
Fix share for insecure:
This commit is contained in:
@@ -134,13 +134,19 @@ export function ShareChatSessionModal({
|
|||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
setLinkGenerating(true);
|
setLinkGenerating(true);
|
||||||
|
|
||||||
|
// NOTE: for "inescure" non-https setup, the `navigator.clipboard.writeText` may fail
|
||||||
|
// as the browser may not allow the clipboard to be accessed.
|
||||||
|
try {
|
||||||
const shareLink = await generateShareLink(chatSessionId);
|
const shareLink = await generateShareLink(chatSessionId);
|
||||||
if (!shareLink) {
|
if (!shareLink) {
|
||||||
alert("Failed to generate share link");
|
alert("Failed to generate share link");
|
||||||
} else {
|
} else {
|
||||||
setShareLink(shareLink);
|
setShareLink(shareLink);
|
||||||
navigator.clipboard.writeText(shareLink);
|
|
||||||
onShare && onShare(true);
|
onShare && onShare(true);
|
||||||
|
navigator.clipboard.writeText(shareLink);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
setLinkGenerating(false);
|
setLinkGenerating(false);
|
||||||
|
Reference in New Issue
Block a user