@@ -23,7 +23,7 @@ import {
23
23
} from "../../client"
24
24
import useAuth from "../../hooks/useAuth"
25
25
import useCustomToast from "../../hooks/useCustomToast"
26
- import { emailPattern } from "../../utils"
26
+ import { emailPattern , handleError } from "../../utils"
27
27
28
28
const UserInformation = ( ) => {
29
29
const queryClient = useQueryClient ( )
@@ -57,13 +57,10 @@ const UserInformation = () => {
57
57
showToast ( "Success!" , "User updated successfully." , "success" )
58
58
} ,
59
59
onError : ( err : ApiError ) => {
60
- const errDetail = ( err . body as any ) ?. detail
61
- showToast ( "Something went wrong." , `${ errDetail } ` , "error" )
60
+ handleError ( err , showToast )
62
61
} ,
63
62
onSettled : ( ) => {
64
- // TODO: can we do just one call now?
65
- queryClient . invalidateQueries ( { queryKey : [ "users" ] } )
66
- queryClient . invalidateQueries ( { queryKey : [ "currentUser" ] } )
63
+ queryClient . invalidateQueries ( )
67
64
} ,
68
65
} )
69
66
@@ -104,6 +101,8 @@ const UserInformation = () => {
104
101
size = "md"
105
102
py = { 2 }
106
103
color = { ! currentUser ?. full_name ? "ui.dim" : "inherit" }
104
+ isTruncated
105
+ maxWidth = "250px"
107
106
>
108
107
{ currentUser ?. full_name || "N/A" }
109
108
</ Text >
@@ -125,7 +124,7 @@ const UserInformation = () => {
125
124
w = "auto"
126
125
/>
127
126
) : (
128
- < Text size = "md" py = { 2 } >
127
+ < Text size = "md" py = { 2 } isTruncated maxWidth = "250px" >
129
128
{ currentUser ?. email }
130
129
</ Text >
131
130
) }
0 commit comments