chore: disable rules in oxlint (#9154)

This commit is contained in:
Brooooooklyn
2024-12-13 10:49:35 +00:00
parent 2452ccd1e5
commit ea746e3d77
53 changed files with 621 additions and 269 deletions

View File

@@ -38,7 +38,11 @@ export function DataTableRowActions({ user }: DataTableRowActionsProps) {
const { resetPasswordLink, onResetPassword } = useResetUserPassword();
const openResetPasswordDialog = useCallback(() => {
onResetPassword(user.id, () => setResetPasswordDialogOpen(true));
onResetPassword(user.id, () => setResetPasswordDialogOpen(true)).catch(
e => {
console.error(e);
}
);
}, [onResetPassword, user.id]);
const handleCopy = useCallback(() => {

View File

@@ -53,7 +53,7 @@ export const useCreateUser = () => {
toast.error('Failed to update account: ' + (e as Error).message);
}
},
[createAccount, revalidate]
[createAccount, revalidate, updateAccountFeatures]
);
return { creating: creating || !!error, create };
@@ -99,7 +99,7 @@ export const useUpdateUser = () => {
toast.error('Failed to update account: ' + (e as Error).message);
}
},
[revalidate, updateAccount]
[revalidate, updateAccount, updateAccountFeatures]
);
return { updating: updating || !!error, update };

View File

@@ -26,7 +26,7 @@ export function UserDropdown() {
fetch('/api/auth/sign-out')
.then(() => {
toast.success('Logged out successfully');
relative();
return relative();
})
.catch(err => {
toast.error(`Failed to logout: ${err.message}`);

View File

@@ -6,6 +6,7 @@ import {
CarouselItem,
} from '@affine/admin/components/ui/carousel';
import { validateEmailAndPassword } from '@affine/admin/utils';
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
import { useCallback, useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { toast } from 'sonner';
@@ -120,7 +121,7 @@ export const Form = () => {
}
}, [emailValue, passwordValue, refreshServerConfig]);
const onNext = useCallback(async () => {
const onNext = useAsyncCallback(async () => {
if (isCreateAdminStep) {
if (
!validateEmailAndPassword(