fix(app): use keyed Show for project in layout (#26985)
This commit is contained in:
@@ -2097,6 +2097,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
</div>
|
</div>
|
||||||
</Show>
|
</Show>
|
||||||
}
|
}
|
||||||
|
keyed
|
||||||
>
|
>
|
||||||
{(project) => (
|
{(project) => (
|
||||||
<>
|
<>
|
||||||
@@ -2107,9 +2108,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
id={`project:${projectId()}`}
|
id={`project:${projectId()}`}
|
||||||
value={projectName}
|
value={projectName}
|
||||||
onSave={(next) => {
|
onSave={(next) => {
|
||||||
const item = project()
|
void renameProject(project, next)
|
||||||
if (!item) return
|
|
||||||
void renameProject(item, next)
|
|
||||||
}}
|
}}
|
||||||
class="text-14-medium text-text-strong truncate"
|
class="text-14-medium text-text-strong truncate"
|
||||||
displayClass="text-14-medium text-text-strong truncate"
|
displayClass="text-14-medium text-text-strong truncate"
|
||||||
@@ -2151,9 +2150,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
<DropdownMenu.Content class="mt-1">
|
<DropdownMenu.Content class="mt-1">
|
||||||
<DropdownMenu.Item
|
<DropdownMenu.Item
|
||||||
onSelect={() => {
|
onSelect={() => {
|
||||||
const item = project()
|
showEditProjectDialog(project)
|
||||||
if (!item) return
|
|
||||||
showEditProjectDialog(item)
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<DropdownMenu.ItemLabel>{language.t("common.edit")}</DropdownMenu.ItemLabel>
|
<DropdownMenu.ItemLabel>{language.t("common.edit")}</DropdownMenu.ItemLabel>
|
||||||
@@ -2163,9 +2160,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
data-project={slug()}
|
data-project={slug()}
|
||||||
disabled={!canToggle()}
|
disabled={!canToggle()}
|
||||||
onSelect={() => {
|
onSelect={() => {
|
||||||
const item = project()
|
toggleProjectWorkspaces(project)
|
||||||
if (!item) return
|
|
||||||
toggleProjectWorkspaces(item)
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<DropdownMenu.ItemLabel>
|
<DropdownMenu.ItemLabel>
|
||||||
@@ -2224,7 +2219,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
<div class="flex-1 min-h-0">
|
<div class="flex-1 min-h-0">
|
||||||
<LocalWorkspace
|
<LocalWorkspace
|
||||||
ctx={workspaceSidebarCtx}
|
ctx={workspaceSidebarCtx}
|
||||||
project={project()}
|
project={project}
|
||||||
sortNow={sortNow}
|
sortNow={sortNow}
|
||||||
mobile={panelProps.mobile}
|
mobile={panelProps.mobile}
|
||||||
/>
|
/>
|
||||||
@@ -2239,9 +2234,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
icon="plus-small"
|
icon="plus-small"
|
||||||
class="w-full"
|
class="w-full"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const item = project()
|
void createWorkspace(project)
|
||||||
if (!item) return
|
|
||||||
void createWorkspace(item)
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{language.t("workspace.new")}
|
{language.t("workspace.new")}
|
||||||
@@ -2268,7 +2261,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
<SortableWorkspace
|
<SortableWorkspace
|
||||||
ctx={workspaceSidebarCtx}
|
ctx={workspaceSidebarCtx}
|
||||||
directory={directory}
|
directory={directory}
|
||||||
project={project()}
|
project={project}
|
||||||
sortNow={sortNow}
|
sortNow={sortNow}
|
||||||
mobile={panelProps.mobile}
|
mobile={panelProps.mobile}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user