Skip to content

Commit d7424e4

Browse files
author
Your Name
committed
fix workspace
1 parent ccd38c4 commit d7424e4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,7 @@ export function Workspace() {
13821382
className="btn btn-sm btn-light d-inline-block border border-dark form-control h-100 p-0 pl-2 pr-2 text-dark"
13831383
icon={null}
13841384
>
1385-
{global.fs.browser.isRequestingCloning ? <i className="fad fa-spinner fa-spin"></i> : currentBranch.name || '-none-'}
1385+
{global.fs.browser.isRequestingCloning ? <i className="fad fa-spinner fa-spin"></i> : (currentBranch && currentBranch.name) || '-none-'}
13861386
</Dropdown.Toggle>
13871387
<Dropdown.Menu as={CustomMenu} className="custom-dropdown-items branches-dropdown">
13881388
<div data-id="custom-dropdown-menu">
@@ -1421,16 +1421,16 @@ export function Workspace() {
14211421
}}
14221422
title={intl.formatMessage({ id: `filePanel.switchToBranch${branch.remote ? 'Title1' : 'Title2'}` })}
14231423
>
1424-
<div data-id={`workspaceGit-${branch.remote ? `${branch.remote}/${branch.name}` : branch.name}`}>
1425-
{currentBranch.name === branch.name && !branch.remote ? (
1424+
<div data-id={`workspaceGit-${branch.remote ? `${branch.remote.name}/${branch.name}` : branch.name}`}>
1425+
{currentBranch && currentBranch.name === branch.name && !branch.remote ? (
14261426
<span>
14271427
&#10003; <i className="far fa-code-branch"></i>
14281428
<span className="pl-1">{branch.name}</span>
14291429
</span>
14301430
) : (
14311431
<span className="pl-3">
14321432
<i className={`far ${branch.remote ? 'fa-cloud' : 'fa-code-branch'}`}></i>
1433-
<span className="pl-1">{branch.remote ? `${branch.remote}/${branch.name}` : branch.name}</span>
1433+
<span className="pl-1">{branch.remote ? `${branch.remote.name}/${branch.name}` : branch.name}</span>
14341434
</span>
14351435
)}
14361436
</div>
@@ -1442,7 +1442,7 @@ export function Workspace() {
14421442
<div className="pl-1 pr-1" data-id="workspaceGitCreateNewBranch">
14431443
<i className="fas fa-code-branch pr-2"></i>
14441444
<span>
1445-
<FormattedMessage id="filePanel.createBranch" />: {branchFilter} from '{currentBranch.name}'
1445+
<FormattedMessage id="filePanel.createBranch" />: {branchFilter} from '{currentBranch && currentBranch.name}'
14461446
</span>
14471447
</div>
14481448
</Dropdown.Item>

0 commit comments

Comments
 (0)