Renamed nullable utils into isDefined and isUndefinedOrNull (#4402)

* Renamed nullable utils into isDefined and isUndefinedOrNull
This commit is contained in:
Lucas Bordeau
2024-03-11 14:28:57 +01:00
committed by GitHub
parent 3f15cc5b7a
commit 581dfafe11
169 changed files with 469 additions and 493 deletions

View File

@ -6,8 +6,8 @@ import { useRecoilValue } from 'recoil';
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { TextInput } from '@/ui/input/components/TextInput';
import { useUpdateWorkspaceMutation } from '~/generated/graphql';
import { isNonNullable } from '~/utils/isNonNullable';
import { isNullable } from '~/utils/isNullable';
import { isDefined } from '~/utils/isDefined';
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
import { logError } from '~/utils/logError';
const StyledComboInputContainer = styled.div`
@ -39,7 +39,7 @@ export const NameField = ({
// eslint-disable-next-line react-hooks/exhaustive-deps
const debouncedUpdate = useCallback(
debounce(async (name: string) => {
if (isNonNullable(onNameUpdate)) {
if (isDefined(onNameUpdate)) {
onNameUpdate(displayName);
}
if (!autoSave || !name) {
@ -54,7 +54,7 @@ export const NameField = ({
},
});
if (isNonNullable(errors) || isNullable(data?.updateWorkspace)) {
if (isDefined(errors) || isUndefinedOrNull(data?.updateWorkspace)) {
throw errors;
}
} catch (error) {

View File

@ -7,7 +7,7 @@ import {
useUpdateWorkspaceMutation,
useUploadWorkspaceLogoMutation,
} from '~/generated/graphql';
import { isNullable } from '~/utils/isNullable';
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
export const WorkspaceLogoUploader = () => {
const [uploadLogo] = useUploadWorkspaceLogoMutation();
@ -17,7 +17,7 @@ export const WorkspaceLogoUploader = () => {
);
const onUpload = async (file: File) => {
if (isNullable(file)) {
if (isUndefinedOrNull(file)) {
return;
}
if (!currentWorkspace?.id) {