Skip to content

Commit

Permalink
fix(llm): fix bug that showed unpublished prompts to non-admins
Browse files Browse the repository at this point in the history
  • Loading branch information
nsantacruz committed Feb 26, 2024
1 parent 0184370 commit d8257d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions static/js/Story.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ const useReviewState = (topic, text) => {
return [reviewState, markReviewed]
}

const VisibilityWrapper = ({children, topic, text}) => {
let lang = Sefaria.interfaceLang === "english" ? 'he' : 'en';
const VisibilityWrapper = ({children, text}) => {
let lang = Sefaria.interfaceLang === "english" ? 'en' : 'he';
const isPromptPublished = text.descriptions?.[lang]?.published;
if (isPromptPublished !== false || Sefaria.is_moderator) {
if (isPromptPublished === true || Sefaria.is_moderator) {
return children;
}
return null;
Expand All @@ -191,7 +191,7 @@ const IntroducedTextPassage = ({text, topic, afterSave, toggleSignUpModal, bodyT

return (
<StoryFrame cls="introducedTextPassageStory">
<VisibilityWrapper topic={topic} text={text}>
<VisibilityWrapper text={text}>
<div className={"headerWithAdminButtonsContainer"}>
<CategoryHeader type="sources" data={[topic, text]} toggleButtonIDs={["edit"]}>
<StoryTitleBlock en={text.descriptions?.en?.title} he={text.descriptions?.he?.title}/>
Expand Down

0 comments on commit d8257d5

Please sign in to comment.