Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix cannot save local network to workspace #377

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/components/ToolBar/DataMenu/SaveWorkspaceToNDEx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,16 @@ export const SaveWorkspaceToNDExMenuItem = (
)

const workspace = await getWorkspaceFromDb(currentWorkspaceId)
const onlyNdexNetworkIds = workspace.networkIds.filter(id => summaries[id]?.isNdex !== false);
Copy link
Contributor

@GAOChengzhan GAOChengzhan Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Yihang,

a minor advice here: I think it is better to change id => summaries[id]?.isNdex !== false to id => summaries[id]?.isNdex ===true.

The reason for that is:

  • summaries[id]?.isNdex === true explicitly checks that the value of isNdex is true (i.e., the boolean true).
  • summaries[id]?.isNdex !== false is broader and includes any value that is not strictly false, such as undefined, null

const response = await ndexClient.createCyWebWorkspace({
name: workspaceName,
options: { currentNetwork: workspace.currentNetworkId },
networkIDs: workspace.networkIds,
networkIDs: onlyNdexNetworkIds,
})
const { uuid, modificationTime } = response
setId(uuid)
renameWorkspace(workspaceName)

console.log(modificationTime)

addMessage({
message: `Saved workspace to NDEx successfully.`,
duration: 3000,
Expand Down