Skip to content
Snippets Groups Projects
Commit 2df183c2 authored by danieldeng2's avatar danieldeng2
Browse files

Simplify code when clicking cards

parent 580ad6b3
No related branches found
No related tags found
No related merge requests found
...@@ -83,9 +83,7 @@ class QuickAccess extends React.Component<QuickAccessProps, MyState> { ...@@ -83,9 +83,7 @@ class QuickAccess extends React.Component<QuickAccessProps, MyState> {
handleCardClick(id: number) { handleCardClick(id: number) {
if (this.isAnySelected()) { if (this.isAnySelected()) {
let isSelected = JSON.parse(JSON.stringify(this.state.isSelected)); this.handleIconClick(id);
isSelected[id] = !isSelected[id];
this.setState({ isSelected });
} }
} }
......
...@@ -75,9 +75,7 @@ class ResourceFolders extends React.Component<ResourceFoldersProps, MyState> { ...@@ -75,9 +75,7 @@ class ResourceFolders extends React.Component<ResourceFoldersProps, MyState> {
handleCardClick(id: number) { handleCardClick(id: number) {
if (this.isAnySelected()) { if (this.isAnySelected()) {
let isSelected = JSON.parse(JSON.stringify(this.state.isSelected)); this.handleIconClick(id);
isSelected[id] = !isSelected[id];
this.setState({ isSelected });
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment