mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 12:19:06 +00:00
If sendToZulip is disabled, then <ShareModal /> won't be loaded
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,3 +4,4 @@ server/.env
|
||||
server/exportdanswer
|
||||
.vercel
|
||||
.env*.local
|
||||
dump.rdb
|
||||
|
||||
@@ -42,6 +42,7 @@ export const featureEnabled = (
|
||||
featureName: "requireLogin" | "privacy" | "browse" | "sendToZulip",
|
||||
) => {
|
||||
const context = useContext(DomainContext);
|
||||
console.log(context.features, featureName);
|
||||
return context.features[featureName] as boolean | undefined;
|
||||
};
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import WaveformLoading from "../waveformLoading";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { faSpinner } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { featureEnabled } from "../../domainContext";
|
||||
|
||||
type TranscriptDetails = {
|
||||
params: {
|
||||
@@ -75,16 +76,18 @@ export default function TranscriptDetails(details: TranscriptDetails) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<ShareModal
|
||||
transcript={transcript.response}
|
||||
topics={topics ? topics.topics : null}
|
||||
show={showModal}
|
||||
setShow={(v) => setShowModal(v)}
|
||||
title={transcript?.response?.title}
|
||||
summary={transcript?.response?.longSummary}
|
||||
date={transcript?.response?.createdAt}
|
||||
url={window.location.href}
|
||||
/>
|
||||
{featureEnabled("sendToZulip") && (
|
||||
<ShareModal
|
||||
transcript={transcript.response}
|
||||
topics={topics ? topics.topics : null}
|
||||
show={showModal}
|
||||
setShow={(v) => setShowModal(v)}
|
||||
title={transcript?.response?.title}
|
||||
summary={transcript?.response?.longSummary}
|
||||
date={transcript?.response?.createdAt}
|
||||
url={window.location.href}
|
||||
/>
|
||||
)}
|
||||
<div className="flex flex-col">
|
||||
{transcript?.response?.title && (
|
||||
<TranscriptTitle
|
||||
|
||||
@@ -6,7 +6,7 @@ const localConfig = {
|
||||
requireLogin: true,
|
||||
privacy: true,
|
||||
browse: true,
|
||||
sendToZulip: true,
|
||||
sendToZulip: false,
|
||||
},
|
||||
api_url: "http://127.0.0.1:1250",
|
||||
websocket_url: "ws://127.0.0.1:1250",
|
||||
|
||||
Reference in New Issue
Block a user