fix: remove dependency of t from appState.name

This commit is contained in:
Aakansha Doshi
2024-02-02 12:20:08 +05:30
parent 0c3dffb082
commit 0a34093dce
6 changed files with 317 additions and 315 deletions

View File

@@ -19,6 +19,7 @@ import { nativeFileSystemSupported } from "../data/filesystem";
import { Theme } from "../element/types";
import "../components/ToolIcon.scss";
import { getDateTime } from "../utils";
export const actionChangeProjectName = register({
name: "changeProjectName",
@@ -29,7 +30,7 @@ export const actionChangeProjectName = register({
PanelComponent: ({ appState, updateData, appProps, data }) => (
<ProjectName
label={t("labels.fileTitle")}
value={appState.name || "Unnamed"}
value={appState.name || `${t("labels.untitled")}-${getDateTime()}`}
onChange={(name: string) => updateData(name)}
isNameEditable={
typeof appProps.name === "undefined" && !appState.viewModeEnabled