Commit 67e3ada 1 parent 9b358e1 commit 67e3ada Copy full SHA for 67e3ada
File tree 2 files changed +8
-11
lines changed
2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -120,13 +120,19 @@ export const getComboCount = (state: State) => {
120
120
return ( count * ( count - 1 ) ) / 2 ;
121
121
} ;
122
122
123
+ const defaultInteraction = {
124
+ interaction : "unknown" ,
125
+ status : "unknown" ,
126
+ description : "" ,
127
+ } ;
128
+
123
129
export const getInteraction = ( ids : string [ ] ) : Interaction => {
124
130
return (
125
131
find ( ( interaction : Interaction ) => {
126
132
// If the difference between this substance's IDs array and our target IDs
127
133
// array is empty, then this interaction is a match.
128
134
return isEmpty ( difference ( interaction . ids , ids ) ) ;
129
- } ) ( interactions ) || { }
135
+ } ) ( interactions ) || defaultInteraction
130
136
) ;
131
137
} ;
132
138
Original file line number Diff line number Diff line change @@ -22,17 +22,8 @@ type Props = {
22
22
secondId : string ,
23
23
} & StateProps ;
24
24
25
- const defaultInteraction = {
26
- interaction : "unknown" ,
27
- status : "unknown" ,
28
- description : "" ,
29
- } ;
30
-
31
25
const Combo = ( props : Props ) => {
32
- const { first, second } = props ;
33
- const interaction = isEmpty ( props . interaction )
34
- ? defaultInteraction
35
- : props . interaction ;
26
+ const { first, second, interaction } = props ;
36
27
37
28
return (
38
29
< div >
You can’t perform that action at this time.
0 commit comments