@@ -20,7 +20,6 @@ const userContext = createContext<{
|
||||
isLoading: boolean
|
||||
isSaving: boolean
|
||||
hasUnsavedChanges: boolean
|
||||
isOAuthProvider: boolean
|
||||
currentWorkspaceId?: string
|
||||
updateUser: (newUser: Partial<User>) => void
|
||||
saveUser: (newUser?: Partial<User>) => Promise<void>
|
||||
@@ -36,10 +35,6 @@ export const UserProvider = ({ children }: { children: ReactNode }) => {
|
||||
const [currentWorkspaceId, setCurrentWorkspaceId] = useState<string>()
|
||||
|
||||
const [isSaving, setIsSaving] = useState(false)
|
||||
const isOAuthProvider = useMemo(
|
||||
() => (session?.providerType as boolean | undefined) ?? false,
|
||||
[session?.providerType]
|
||||
)
|
||||
|
||||
const hasUnsavedChanges = useMemo(
|
||||
() => !dequal(session?.user, user),
|
||||
@@ -97,7 +92,6 @@ export const UserProvider = ({ children }: { children: ReactNode }) => {
|
||||
isSaving,
|
||||
isLoading: status === 'loading',
|
||||
hasUnsavedChanges,
|
||||
isOAuthProvider,
|
||||
currentWorkspaceId,
|
||||
updateUser,
|
||||
saveUser,
|
||||
|
||||
@@ -18,14 +18,7 @@ import { UploadButton } from '@/components/ImageUploadContent/UploadButton'
|
||||
import { useUser } from '@/features/account'
|
||||
|
||||
export const MyAccountForm = () => {
|
||||
const {
|
||||
user,
|
||||
updateUser,
|
||||
saveUser,
|
||||
hasUnsavedChanges,
|
||||
isSaving,
|
||||
isOAuthProvider,
|
||||
} = useUser()
|
||||
const { user, updateUser, saveUser, hasUnsavedChanges, isSaving } = useUser()
|
||||
|
||||
const handleFileUploaded = async (url: string) => {
|
||||
updateUser({ image: url })
|
||||
@@ -74,12 +67,7 @@ export const MyAccountForm = () => {
|
||||
hasArrow
|
||||
>
|
||||
<FormControl>
|
||||
<FormLabel
|
||||
htmlFor="email"
|
||||
color={isOAuthProvider ? 'gray.500' : 'current'}
|
||||
>
|
||||
Email address
|
||||
</FormLabel>
|
||||
<FormLabel htmlFor="email">Email address</FormLabel>
|
||||
<Input
|
||||
id="email"
|
||||
type="email"
|
||||
|
||||
Reference in New Issue
Block a user