@@ -2,7 +2,7 @@ import React, { Component } from 'react';
2
2
import { connect } from 'react-redux' ;
3
3
import PropTypes from 'prop-types' ;
4
4
import { withTranslation } from 'react-i18next' ;
5
- import { List } from 'immutable' ;
5
+ import { List , Set } from 'immutable' ;
6
6
import { withRouter } from 'react-router' ;
7
7
import classNames from 'classnames' ;
8
8
import { withStyles } from '@material-ui/core/styles' ;
@@ -27,7 +27,7 @@ import Main from './components/common/Main';
27
27
import { HOME_PATH } from './config/paths' ;
28
28
import WelcomeContent from './components/common/WelcomeContent' ;
29
29
30
- const styles = theme => ( {
30
+ const styles = ( theme ) => ( {
31
31
...Styles ( theme ) ,
32
32
wrapper : {
33
33
marginTop : theme . spacing ( 2 ) ,
@@ -66,7 +66,7 @@ class Home extends Component {
66
66
history : PropTypes . shape ( {
67
67
replace : PropTypes . func . isRequired ,
68
68
} ) . isRequired ,
69
- spaces : PropTypes . instanceOf ( List ) . isRequired ,
69
+ spaces : PropTypes . instanceOf ( Set ) . isRequired ,
70
70
activity : PropTypes . bool ,
71
71
favoriteSpaces : PropTypes . instanceOf ( List ) . isRequired ,
72
72
recentSpaces : PropTypes . instanceOf ( List ) . isRequired ,
@@ -123,14 +123,14 @@ class Home extends Component {
123
123
}
124
124
}
125
125
126
- filterSpaces = spaces => {
126
+ filterSpaces = ( spaces ) => {
127
127
const { searchQuery, spaces : originalSpaces } = this . props ;
128
128
// get space content by id
129
129
let filteredSpaces = spaces
130
- . map ( id => originalSpaces . find ( ( { id : spaceId } ) => id === spaceId ) )
130
+ . map ( ( id ) => originalSpaces . find ( ( { id : spaceId } ) => id === spaceId ) )
131
131
// remove undefined space
132
132
// this case can happen if originalSpaces is updated before spaces
133
- . filter ( space => space ) ;
133
+ . filter ( ( space ) => space ) ;
134
134
135
135
filteredSpaces = searchSpacesByQuery ( filteredSpaces , searchQuery ) ;
136
136
return filteredSpaces ;
0 commit comments