Merge branch 'main' into switch-to-vite
This commit is contained in:
		
						commit
						d1e59fe08c
					
				
					 10 changed files with 116 additions and 22 deletions
				
			
		|  | @ -994,6 +994,7 @@ const TokenDialog = (props) => { | |||
| 
 | ||||
| const TokenDeleteDialog = (props) => { | ||||
|   const { t } = useTranslation(); | ||||
|   const [error, setError] = useState(""); | ||||
| 
 | ||||
|   const handleSubmit = async () => { | ||||
|     try { | ||||
|  | @ -1003,6 +1004,8 @@ const TokenDeleteDialog = (props) => { | |||
|       console.log(`[Account] Error deleting token`, e); | ||||
|       if (e instanceof UnauthorizedError) { | ||||
|         session.resetAndRedirect(routes.login); | ||||
|       } else { | ||||
|         setError(e.message); | ||||
|       } | ||||
|     } | ||||
|   }; | ||||
|  | @ -1015,7 +1018,7 @@ const TokenDeleteDialog = (props) => { | |||
|           <Trans i18nKey="account_tokens_delete_dialog_description" /> | ||||
|         </DialogContentText> | ||||
|       </DialogContent> | ||||
|       <DialogFooter status> | ||||
|       <DialogFooter status={error}> | ||||
|         <Button onClick={props.onClose}>{t("common_cancel")}</Button> | ||||
|         <Button onClick={handleSubmit} color="error"> | ||||
|           {t("account_tokens_delete_dialog_submit_button")} | ||||
|  |  | |||
|  | @ -27,14 +27,13 @@ export const AccountContext = createContext(null); | |||
| 
 | ||||
| const App = () => { | ||||
|   const [account, setAccount] = useState(null); | ||||
| 
 | ||||
|   const contextValue = useMemo(() => ({ account, setAccount }), [account, setAccount]); | ||||
|   const accountMemo = useMemo(() => ({ account, setAccount }), [account, setAccount]); | ||||
| 
 | ||||
|   return ( | ||||
|     <Suspense fallback={<Loader />}> | ||||
|       <BrowserRouter> | ||||
|         <ThemeProvider theme={theme}> | ||||
|           <AccountContext.Provider value={contextValue}> | ||||
|           <AccountContext.Provider value={accountMemo}> | ||||
|             <CssBaseline /> | ||||
|             <ErrorBoundary> | ||||
|               <Routes> | ||||
|  |  | |||
|  | @ -74,6 +74,8 @@ const EmojiPicker = (props) => { | |||
|                 inputProps={{ | ||||
|                   role: "searchbox", | ||||
|                   "aria-label": t("emoji_picker_search_placeholder"), | ||||
|                 }} | ||||
|                 InputProps={{ | ||||
|                   endAdornment: ( | ||||
|                     <InputAdornment position="end" sx={{ display: search ? "" : "none" }}> | ||||
|                       <IconButton size="small" onClick={handleSearchClear} edge="end" aria-label={t("emoji_picker_search_clear")}> | ||||
|  |  | |||
|  | @ -45,9 +45,10 @@ class ErrorBoundaryImpl extends React.Component { | |||
|     // Fetch additional info and a better stack trace | ||||
|     StackTrace.fromError(error).then((stack) => { | ||||
|       console.error("[ErrorBoundary] Stacktrace fetched", stack); | ||||
|       const niceStack = `${error.toString()}\n${stack | ||||
|         .map((el) => `  at ${el.functionName} (${el.fileName}:${el.columnNumber}:${el.lineNumber})`) | ||||
|         .join("\n")}`; | ||||
|       const stackString = stack | ||||
|           .map((el) => `  at ${el.functionName} (${el.fileName}:${el.columnNumber}:${el.lineNumber})`) | ||||
|           .join("\n"); | ||||
|       const niceStack = `${error.toString()}\n${stackString}`; | ||||
|       this.setState({ niceStack }); | ||||
|     }); | ||||
|   } | ||||
|  |  | |||
|  | @ -383,23 +383,23 @@ const PublishDialog = (props) => { | |||
|                   "aria-label": t("publish_dialog_priority_label"), | ||||
|                 }} | ||||
|               > | ||||
|                 {[5, 4, 3, 2, 1].map((priorityMenuItem) => ( | ||||
|                 {[5, 4, 3, 2, 1].map((p) => ( | ||||
|                   <MenuItem | ||||
|                     key={`priorityMenuItem${priorityMenuItem}`} | ||||
|                     value={priorityMenuItem} | ||||
|                     key={`priorityMenuItem${p}`} | ||||
|                     value={p} | ||||
|                     aria-label={t("notifications_priority_x", { | ||||
|                       priority: priorityMenuItem, | ||||
|                       priority: p, | ||||
|                     })} | ||||
|                   > | ||||
|                     <div style={{ display: "flex", alignItems: "center" }}> | ||||
|                       <img | ||||
|                         src={priorities[priorityMenuItem].file} | ||||
|                         src={priorities[p].file} | ||||
|                         style={{ marginRight: "8px" }} | ||||
|                         alt={t("notifications_priority_x", { | ||||
|                           priority: priorityMenuItem, | ||||
|                           priority: p, | ||||
|                         })} | ||||
|                       /> | ||||
|                       <div>{priorities[priorityMenuItem].label}</div> | ||||
|                       <div>{priorities[p].label}</div> | ||||
|                     </div> | ||||
|                   </MenuItem> | ||||
|                 ))} | ||||
|  | @ -477,10 +477,8 @@ const PublishDialog = (props) => { | |||
|                     "aria-label": t("publish_dialog_call_label"), | ||||
|                   }} | ||||
|                 > | ||||
|                   {account?.phone_numbers?.map((phoneNumber, i) => ( | ||||
|                     // TODO(eslint): Possibly just use the phone number as a key? | ||||
|                     // eslint-disable-next-line react/no-array-index-key | ||||
|                     <MenuItem key={`phoneNumberMenuItem${i}`} value={phoneNumber} aria-label={phoneNumber}> | ||||
|                   {account?.phone_numbers?.map((phoneNumber) => ( | ||||
|                     <MenuItem key={phoneNumber} value={phoneNumber} aria-label={phoneNumber}> | ||||
|                       {t("publish_dialog_call_item", { number: phoneNumber })} | ||||
|                     </MenuItem> | ||||
|                   ))} | ||||
|  | @ -834,7 +832,10 @@ const ExpandingTextField = (props) => { | |||
|         variant="standard" | ||||
|         sx={{ width: `${textWidth}px`, borderBottom: "none" }} | ||||
|         InputProps={{ | ||||
|           style: { fontSize: theme.typography[props.variant].fontSize, paddingBottom: 0, paddingTop: 0 }, | ||||
|           style: { fontSize: theme.typography[props.variant].fontSize }, | ||||
|         }} | ||||
|         inputProps={{ | ||||
|           style: { paddingBottom: 0, paddingTop: 0 }, | ||||
|           "aria-label": props.placeholder, | ||||
|         }} | ||||
|         disabled={props.disabled} | ||||
|  |  | |||
|  | @ -247,6 +247,8 @@ const DisplayNameDialog = (props) => { | |||
|           inputProps={{ | ||||
|             maxLength: 64, | ||||
|             "aria-label": t("display_name_dialog_placeholder"), | ||||
|           }} | ||||
|           InputProps={{ | ||||
|             endAdornment: ( | ||||
|               <InputAdornment position="end"> | ||||
|                 <IconButton onClick={() => setDisplayName("")} edge="end"> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue