a tool for shared writing and social publishing

wired up post options to update record

+34 -22
+33 -21
app/lish/[did]/[publication]/dashboard/settings/PostOptions.tsx
··· 22 22 ? true 23 23 : record.preferences.showComments, 24 24 ); 25 - let [showMentions, setShowMentions] = useState(true); 26 - let [showPrevNext, setShowPrevNext] = useState(true); 25 + let [showMentions, setShowMentions] = useState( 26 + record?.preferences?.showMentions === undefined 27 + ? true 28 + : record.preferences.showMentions, 29 + ); 30 + let [showPrevNext, setShowPrevNext] = useState( 31 + record?.preferences?.showPrevNext === undefined 32 + ? true 33 + : record.preferences.showPrevNext, 34 + ); 27 35 28 36 let toast = useToaster(); 29 37 return ( 30 38 <form 31 39 onSubmit={async (e) => { 32 - // if (!pubData) return; 33 - // e.preventDefault(); 34 - // props.setLoading(true); 35 - // let data = await updatePublication({ 36 - // name: record.name, 37 - // uri: pubData.uri, 38 - // preferences: { 39 - // showInDiscover: 40 - // record?.preferences?.showInDiscover === undefined 41 - // ? true 42 - // : record.preferences.showInDiscover, 43 - // showComments: showComments, 44 - // }, 45 - // }); 46 - // toast({ type: "success", content: "Posts Updated!" }); 47 - // props.setLoading(false); 48 - // mutate("publication-data"); 40 + if (!pubData) return; 41 + e.preventDefault(); 42 + props.setLoading(true); 43 + let data = await updatePublication({ 44 + name: record.name, 45 + uri: pubData.uri, 46 + preferences: { 47 + showInDiscover: 48 + record?.preferences?.showInDiscover === undefined 49 + ? true 50 + : record.preferences.showInDiscover, 51 + showComments: showComments, 52 + showMentions: showMentions, 53 + showPrevNext: showPrevNext, 54 + }, 55 + }); 56 + toast({ type: "success", content: "Posts Updated!" }); 57 + props.setLoading(false); 58 + mutate("publication-data"); 49 59 }} 50 60 className="text-primary flex flex-col" 51 61 > ··· 67 77 <div className="flex flex-col justify-start"> 68 78 <div className="font-bold">Show Prev/Next Buttons</div> 69 79 <div className="text-tertiary text-sm leading-tight"> 70 - Show buttons that navigate to the previous and next posts 80 + Buttons at the bottom of each post navigate to the previous and next 81 + posts 71 82 </div> 72 83 </div> 73 84 </Toggle> ··· 92 103 <div className="flex flex-col justify-start"> 93 104 <div className="font-bold">Show Mentions</div> 94 105 <div className="text-tertiary text-sm leading-tight"> 95 - Display a list of posts on Bluesky that mention your post 106 + Display a list of posts on Bluesky and Leaflet that mention your 107 + post 96 108 </div> 97 109 </div> 98 110 </Toggle>
+1 -1
lexicons/src/publication.ts
··· 28 28 showInDiscover: { type: "boolean", default: true }, 29 29 showComments: { type: "boolean", default: true }, 30 30 showMentions: { type: "boolean", default: true }, 31 - showPrevNext: { type: "boolean", default: true }, 31 + showPrevNext: { type: "boolean", default: false }, 32 32 }, 33 33 }, 34 34 theme: {