mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29: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
|
server/exportdanswer
|
||||||
.vercel
|
.vercel
|
||||||
.env*.local
|
.env*.local
|
||||||
|
dump.rdb
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ export const featureEnabled = (
|
|||||||
featureName: "requireLogin" | "privacy" | "browse" | "sendToZulip",
|
featureName: "requireLogin" | "privacy" | "browse" | "sendToZulip",
|
||||||
) => {
|
) => {
|
||||||
const context = useContext(DomainContext);
|
const context = useContext(DomainContext);
|
||||||
|
console.log(context.features, featureName);
|
||||||
return context.features[featureName] as boolean | undefined;
|
return context.features[featureName] as boolean | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import WaveformLoading from "../waveformLoading";
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { faSpinner } from "@fortawesome/free-solid-svg-icons";
|
import { faSpinner } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
import { featureEnabled } from "../../domainContext";
|
||||||
|
|
||||||
type TranscriptDetails = {
|
type TranscriptDetails = {
|
||||||
params: {
|
params: {
|
||||||
@@ -75,6 +76,7 @@ export default function TranscriptDetails(details: TranscriptDetails) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
{featureEnabled("sendToZulip") && (
|
||||||
<ShareModal
|
<ShareModal
|
||||||
transcript={transcript.response}
|
transcript={transcript.response}
|
||||||
topics={topics ? topics.topics : null}
|
topics={topics ? topics.topics : null}
|
||||||
@@ -85,6 +87,7 @@ export default function TranscriptDetails(details: TranscriptDetails) {
|
|||||||
date={transcript?.response?.createdAt}
|
date={transcript?.response?.createdAt}
|
||||||
url={window.location.href}
|
url={window.location.href}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
{transcript?.response?.title && (
|
{transcript?.response?.title && (
|
||||||
<TranscriptTitle
|
<TranscriptTitle
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const localConfig = {
|
|||||||
requireLogin: true,
|
requireLogin: true,
|
||||||
privacy: true,
|
privacy: true,
|
||||||
browse: true,
|
browse: true,
|
||||||
sendToZulip: true,
|
sendToZulip: false,
|
||||||
},
|
},
|
||||||
api_url: "http://127.0.0.1:1250",
|
api_url: "http://127.0.0.1:1250",
|
||||||
websocket_url: "ws://127.0.0.1:1250",
|
websocket_url: "ws://127.0.0.1:1250",
|
||||||
|
|||||||
Reference in New Issue
Block a user