mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-08 03:48:14 +02:00
Fix share for insecure:
This commit is contained in:
parent
5324b15397
commit
8fea6d7f64
@ -134,13 +134,19 @@ export function ShareChatSessionModal({
|
||||
onClick={async () => {
|
||||
setLinkGenerating(true);
|
||||
|
||||
const shareLink = await generateShareLink(chatSessionId);
|
||||
if (!shareLink) {
|
||||
alert("Failed to generate share link");
|
||||
} else {
|
||||
setShareLink(shareLink);
|
||||
navigator.clipboard.writeText(shareLink);
|
||||
onShare && onShare(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);
|
||||
if (!shareLink) {
|
||||
alert("Failed to generate share link");
|
||||
} else {
|
||||
setShareLink(shareLink);
|
||||
onShare && onShare(true);
|
||||
navigator.clipboard.writeText(shareLink);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
setLinkGenerating(false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user