Skip to content

Commit

Permalink
Try fix opened projects
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFlashAccount committed Dec 19, 2024
1 parent ceb7a94 commit 2591fc5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 7 additions & 1 deletion app/gui/src/dashboard/layouts/AssetsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ import {
AssetType,
BackendType,
getAssetPermissionName,
IS_OPENING_OR_OPENED,
Plan,
ProjectId,
ProjectState,
Expand Down Expand Up @@ -1726,6 +1727,11 @@ function AssetsTable(props: AssetsTableProps) {
</td>
</tr>
: displayItems.map((item) => {
const isOpenedByYou = openedProjects.some(({ id }) => item.item.id === id)
const isOpenedOnTheBackend =
item.item.projectState?.type != null ?
IS_OPENING_OR_OPENED[item.item.projectState.type]
: false
return (
<AssetRow
key={item.key + item.path}
Expand All @@ -1736,7 +1742,7 @@ function AssetsTable(props: AssetsTableProps) {
: false
}
onCutAndPaste={cutAndPaste}
isOpened={openedProjects.some(({ id }) => item.item.id === id)}
isOpened={isOpenedByYou || isOpenedOnTheBackend}
visibility={visibilities.get(item.key)}
columns={columns}
id={item.item.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ export function useAsset(id: AssetId) {
return useStore(
ASSET_ITEMS_STORE,
(store) => store.items.find((item) => item.id === id) ?? null,
{
unsafeEnableTransition: true,
},
{ unsafeEnableTransition: true },
)
}

Expand Down

0 comments on commit 2591fc5

Please sign in to comment.