@@ -39,6 +39,7 @@ interface ConfigEditorProps {
3939 initialApiKey : string ;
4040 initialKuaidi100Key : string ;
4141 initialKuaidi100Customer : string ;
42+ initialTelegramTdataPath : string ;
4243 serverPort : number ;
4344 webdavServers : Record < string , WebDAVServer > ;
4445 // Callbacks
@@ -62,6 +63,7 @@ export interface ConfigValues {
6263 apiKey : string ;
6364 kuaidi100Key : string ;
6465 kuaidi100Customer : string ;
66+ telegramTdataPath : string ;
6567}
6668
6769export function ConfigEditor ( {
@@ -74,6 +76,7 @@ export function ConfigEditor({
7476 initialApiKey,
7577 initialKuaidi100Key,
7678 initialKuaidi100Customer,
79+ initialTelegramTdataPath,
7780 serverPort,
7881 webdavServers,
7982 onSave,
@@ -100,6 +103,9 @@ export function ConfigEditor({
100103 const [ pendingKuaidi100Customer , setPendingKuaidi100Customer ] = useState (
101104 initialKuaidi100Customer || ""
102105 ) ;
106+ const [ pendingTelegramTdataPath , setPendingTelegramTdataPath ] = useState (
107+ initialTelegramTdataPath || ""
108+ ) ;
103109
104110 // WebDAV add form
105111 const [ newWebDAVName , setNewWebDAVName ] = useState ( "" ) ;
@@ -120,6 +126,7 @@ export function ConfigEditor({
120126 apiKey : pendingApiKey ,
121127 kuaidi100Key : pendingKuaidi100Key ,
122128 kuaidi100Customer : pendingKuaidi100Customer ,
129+ telegramTdataPath : pendingTelegramTdataPath ,
123130 } ) ;
124131 } finally {
125132 setSavingConfig ( false ) ;
@@ -136,6 +143,7 @@ export function ConfigEditor({
136143 setPendingApiKey ( initialApiKey || "" ) ;
137144 setPendingKuaidi100Key ( initialKuaidi100Key || "" ) ;
138145 setPendingKuaidi100Customer ( initialKuaidi100Customer || "" ) ;
146+ setPendingTelegramTdataPath ( initialTelegramTdataPath || "" ) ;
139147 // Reset WebDAV form
140148 setNewWebDAVName ( "" ) ;
141149 setNewWebDAVUrl ( "" ) ;
@@ -296,6 +304,24 @@ export function ConfigEditor({
296304 </ div >
297305 </ div >
298306
307+ { /* Telegram Section */ }
308+ < div className = "text-sm font-semibold text-zinc-900 dark:text-white mt-4 mb-2 pt-3 border-t border-zinc-300 dark:border-zinc-700" >
309+ Telegram
310+ </ div >
311+ < div className = "flex flex-col sm:flex-row sm:items-center gap-1 sm:gap-3" >
312+ < span className = "sm:min-w-25 text-sm text-zinc-700 dark:text-zinc-200" >
313+ TData Path
314+ </ span >
315+ < input
316+ type = "text"
317+ className = { inputBaseClass }
318+ placeholder = "Custom Telegram Desktop tdata directory path"
319+ value = { pendingTelegramTdataPath }
320+ onChange = { ( e ) => setPendingTelegramTdataPath ( e . target . value ) }
321+ disabled = { ! isConnected || savingConfig }
322+ />
323+ </ div >
324+
299325 { /* WebDAV Servers Section */ }
300326 < div className = "mt-4 pt-4 border-t border-zinc-300 dark:border-zinc-700" >
301327 < div className = "text-sm font-semibold text-zinc-900 dark:text-white mb-3" >
0 commit comments