@@ -51,6 +51,7 @@ function PublishView(props: PublishViewProps) {
5151 current : number ;
5252 } > ( ) ;
5353 const passwordInput = useRef < HTMLInputElement > ( null ) ;
54+ const titleInput = useRef < HTMLInputElement > ( null ) ;
5455 const publishNote = useStore ( ( store ) => store . publish ) ;
5556 const unpublishNote = useStore ( ( store ) => store . unpublish ) ;
5657
@@ -65,6 +66,10 @@ function PublishView(props: PublishViewProps) {
6566 setIsPasswordProtected ( ! ! monograph . password ) ;
6667 setSelfDestruct ( ! ! monograph . selfDestruct ) ;
6768
69+ if ( titleInput . current ) {
70+ titleInput . current . value = monograph . title ;
71+ }
72+
6873 if ( monograph . password ) {
6974 const password = await db . monographs . decryptPassword (
7075 monograph . password
@@ -192,6 +197,19 @@ function PublishView(props: PublishViewProps) {
192197 { strings . monographDesc ( ) }
193198 </ Text >
194199 ) }
200+ < Field
201+ inputRef = { titleInput }
202+ id = "monograph-title"
203+ label = { strings . monographTitle ( ) }
204+ placeholder = { strings . enterMonographTitle ( ) }
205+ defaultValue = { publishId ? "" : note . title }
206+ sx = { {
207+ my : 1 ,
208+ "& > label" : {
209+ fontSize : "body"
210+ }
211+ } }
212+ />
195213 < Toggle
196214 title = { strings . monographSelfDestructHeading ( ) }
197215 tip = { strings . monographSelfDestructDesc ( ) }
@@ -231,8 +249,9 @@ function PublishView(props: PublishViewProps) {
231249 try {
232250 setIsPublishing ( true ) ;
233251 const password = passwordInput . current ?. value ;
252+ const title = titleInput . current ?. value ?? "" ;
234253
235- const publishId = await publishNote ( note . id , {
254+ const publishId = await publishNote ( note . id , title , {
236255 selfDestruct,
237256 password
238257 } ) ;
0 commit comments