fix
This commit is contained in:
parent
0a34093dce
commit
a8047b35b0
|
@ -19,7 +19,6 @@ import { nativeFileSystemSupported } from "../data/filesystem";
|
|||
import { Theme } from "../element/types";
|
||||
|
||||
import "../components/ToolIcon.scss";
|
||||
import { getDateTime } from "../utils";
|
||||
|
||||
export const actionChangeProjectName = register({
|
||||
name: "changeProjectName",
|
||||
|
@ -30,7 +29,7 @@ export const actionChangeProjectName = register({
|
|||
PanelComponent: ({ appState, updateData, appProps, data }) => (
|
||||
<ProjectName
|
||||
label={t("labels.fileTitle")}
|
||||
value={appState.name || `${t("labels.untitled")}-${getDateTime()}`}
|
||||
value={appState.name}
|
||||
onChange={(name: string) => updateData(name)}
|
||||
isNameEditable={
|
||||
typeof appProps.name === "undefined" && !appState.viewModeEnabled
|
||||
|
|
|
@ -18,7 +18,9 @@ type Props = {
|
|||
|
||||
export const ProjectName = (props: Props) => {
|
||||
const { id } = useExcalidrawContainer();
|
||||
const [fileName, setFileName] = useState<string>(props.value);
|
||||
const [fileName, setFileName] = useState<string>(
|
||||
props.value || `${t("labels.untitled")}-${getDateTime()}`,
|
||||
);
|
||||
|
||||
const handleBlur = (event: any) => {
|
||||
if (!props.ignoreFocus) {
|
||||
|
|
Loading…
Reference in New Issue