Renamed nullable utils into isDefined and isUndefinedOrNull (#4402)
* Renamed nullable utils into isDefined and isUndefinedOrNull
This commit is contained in:
@ -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) {
|
||||
|
||||
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user