forked from github/plane
fix: selecting random emoji on create-project
This commit is contained in:
parent
18cf044e3b
commit
a4b738508f
@ -9,7 +9,7 @@ import { Dialog, Transition } from "@headlessui/react";
|
|||||||
import projectServices from "lib/services/project.service";
|
import projectServices from "lib/services/project.service";
|
||||||
import workspaceService from "lib/services/workspace.service";
|
import workspaceService from "lib/services/workspace.service";
|
||||||
// common
|
// common
|
||||||
import { createSimilarString } from "constants/common";
|
import { createSimilarString, getRandomEmoji } from "constants/common";
|
||||||
// constants
|
// constants
|
||||||
import { NETWORK_CHOICES } from "constants/";
|
import { NETWORK_CHOICES } from "constants/";
|
||||||
// fetch keys
|
// fetch keys
|
||||||
@ -32,7 +32,7 @@ const defaultValues: Partial<IProject> = {
|
|||||||
identifier: "",
|
identifier: "",
|
||||||
description: "",
|
description: "",
|
||||||
network: 0,
|
network: 0,
|
||||||
icon: "",
|
icon: getRandomEmoji(),
|
||||||
};
|
};
|
||||||
|
|
||||||
const IsGuestCondition: React.FC<{
|
const IsGuestCondition: React.FC<{
|
||||||
|
@ -39,7 +39,7 @@ const EmojiIconPicker: React.FC<Props> = ({ label, value, onChange }) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!value) onChange(getRandomEmoji());
|
if (!value || value?.length === 0) onChange(getRandomEmoji());
|
||||||
}, [value, onChange]);
|
}, [value, onChange]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user