Skip to content

Commit b0a42d0

Browse files
committed
SketchList does not open a sketch if dialogue box is opened
1 parent 987110d commit b0a42d0

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

client/modules/IDE/components/SketchList.jsx

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ class SketchList extends React.Component {
5555
<table className="sketches-table" summary="table containing all saved projects">
5656
<thead>
5757
<tr>
58-
{/* <th className="sketch-list__trash-column" scope="col"></th> */}
5958
<th scope="col">Sketch</th>
6059
<th scope="col">Date created</th>
6160
<th scope="col">Date created</th>
@@ -68,27 +67,14 @@ class SketchList extends React.Component {
6867
<tr
6968
className="sketches-table__row"
7069
key={sketch.id}
71-
onClick={() => browserHistory.push(`/${username}/sketches/${sketch.id}`)}
70+
onClick={() => {
71+
if (this.state.actionDialogueDisplayed.some(el => el)) {
72+
this.closeAllDropdowns();
73+
return;
74+
}
75+
browserHistory.push(`/${username}/sketches/${sketch.id}`);
76+
}}
7277
>
73-
{/* <td className="sketch-list__trash-column">
74-
{(() => { // eslint-disable-line
75-
if (this.props.username === this.props.user.username || this.props.username === undefined) {
76-
return (
77-
<button
78-
className="sketch-list__trash-button"
79-
onClick={(e) => {
80-
e.stopPropagation();
81-
if (window.confirm(`Are you sure you want to delete "${sketch.name}"?`)) {
82-
this.props.deleteProject(sketch.id);
83-
}
84-
}}
85-
>
86-
<InlineSVG src={trashCan} alt="Delete Project" />
87-
</button>
88-
);
89-
}
90-
})()}
91-
</td> */}
9278
<th scope="row"><Link to={`/${username}/sketches/${sketch.id}`}>{sketch.name}</Link></th>
9379
<td>{moment(sketch.createdAt).format('MMM D, YYYY h:mm A')}</td>
9480
<td>{moment(sketch.updatedAt).format('MMM D, YYYY h:mm A')}</td>

0 commit comments

Comments
 (0)