Skip to content

Commit c7db9f0

Browse files
committed
Fix ESLint: use ?? instead of || for nullish coalescing
1 parent deb3155 commit c7db9f0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ function AppInner() {
322322
projectPath,
323323
config.workspaces.slice().sort((a, b) => {
324324
// Extract workspace ID from path
325-
const aId = a.path.replace(/\\/g, "/").split("/").pop() || "";
326-
const bId = b.path.replace(/\\/g, "/").split("/").pop() || "";
325+
const aId = a.path.replace(/\\/g, "/").split("/").pop() ?? "";
326+
const bId = b.path.replace(/\\/g, "/").split("/").pop() ?? "";
327327
const aMeta = workspaceMetadata.get(aId);
328328
const bMeta = workspaceMetadata.get(bId);
329329
if (!aMeta || !bMeta) return 0;
@@ -378,7 +378,7 @@ function AppInner() {
378378
if (!targetWorkspace) return;
379379

380380
// Extract workspace ID from path
381-
const workspaceId = targetWorkspace.path.replace(/\\/g, "/").split("/").pop() || "";
381+
const workspaceId = targetWorkspace.path.replace(/\\/g, "/").split("/").pop() ?? "";
382382
const metadata = workspaceMetadata.get(workspaceId);
383383
if (!metadata) return;
384384

src/components/ProjectSidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ const ProjectSidebarInner: React.FC<ProjectSidebarProps> = ({
825825
// Extract workspace ID from path (path format: ~/.cmux/src/projectName/workspaceId)
826826
// Handle both Unix (/) and Windows (\) path separators
827827
const pathParts = workspace.path.replace(/\\/g, "/").split("/");
828-
const workspaceId = pathParts[pathParts.length - 1] || "";
828+
const workspaceId = pathParts[pathParts.length - 1] ?? "";
829829
const metadata = workspaceMetadata.get(workspaceId);
830830
if (!metadata) return null;
831831
const isSelected =

0 commit comments

Comments
 (0)