parent
							
								
									cbc912d1e3
								
							
						
					
					
						commit
						dd689fd4a6
					
				
					 1 changed files with 8 additions and 1 deletions
				
			
		|  | @ -90,6 +90,13 @@ const SubscribePage = (props) => { | ||||||
|             return validTopic(topic) && !isExistingTopicUrl; |             return validTopic(topic) && !isExistingTopicUrl; | ||||||
|         } |         } | ||||||
|     })(); |     })(); | ||||||
|  |     const updateBaseUrl = (ev, newVal) => { | ||||||
|  |         if (validUrl(newVal)) { | ||||||
|  |           props.setBaseUrl(newVal.replace(/\/$/, '')); // strip traililng / after https?://
 | ||||||
|  |         } else { | ||||||
|  |           props.setBaseUrl(newVal); | ||||||
|  |         } | ||||||
|  |     }; | ||||||
|     return ( |     return ( | ||||||
|         <> |         <> | ||||||
|             <DialogTitle>{t("subscribe_dialog_subscribe_title")}</DialogTitle> |             <DialogTitle>{t("subscribe_dialog_subscribe_title")}</DialogTitle> | ||||||
|  | @ -128,7 +135,7 @@ const SubscribePage = (props) => { | ||||||
|                     options={existingBaseUrls} |                     options={existingBaseUrls} | ||||||
|                     sx={{ maxWidth: 400 }} |                     sx={{ maxWidth: 400 }} | ||||||
|                     inputValue={props.baseUrl} |                     inputValue={props.baseUrl} | ||||||
|                     onInputChange={(ev, newVal) => props.setBaseUrl(newVal)} |                     onInputChange={updateBaseUrl} | ||||||
|                     renderInput={ (params) => |                     renderInput={ (params) => | ||||||
|                         <TextField |                         <TextField | ||||||
|                             {...params} |                             {...params} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue