Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import path from 'path';
const isProd = process.env.NODE_ENV === 'production';
const basePath = isProd ? (process.env.BASE_PATH || '') : '';
// const targetFolder = process.env.TARGET_FOLDER || '';
const assetPrefix = isProd ? (basePath ? `${basePath.replace(/\/$/, '')}/` : './') : '';
const assetPrefix = isProd ? (basePath ? `${basePath.replace(/\/$/, '')}/` : '') : '';

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/MainPanel/LocalNetCDF.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const LocalNetCDF = ({ setOpenVariables}:LocalNCType) => {
data.getFullMetadata()
])
useGlobalStore.setState({variables: Object.keys(variables), zMeta: metadata, initStore:`local_${file.name}`})
useZarrStore.setState({useNC: true, ncModule: data})
useZarrStore.setState({ fetchNC:true, useNC: true, ncModule: data})

Choose a reason for hiding this comment

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

medium

While setting fetchNC: true here fixes the issue, you've raised a good point in the PR description about unifying the logic for fetchNC and useNC. To improve maintainability and prevent inconsistent states, you could encapsulate this logic in a dedicated action within your ZarrStore.

For example, an action like setNetCDFModule(data) could handle setting ncModule, useNC, and fetchNC together:

// In ZarrStore.ts
setNetCDFModule: (data) => set({ ncModule: data, useNC: !!data, fetchNC: !!data })

// In LocalNetCDF.tsx
// Then you could call it like this, replacing the current setState call:
useZarrStore.getState().setNetCDFModule(data)

This would centralize the state transition logic, making it more robust and easier to reason about. This would require changes in ZarrStore.ts.

const titleDescription = {
title: attrs.title?? file.name,
description: attrs.history?? ''
Expand Down
Loading