diff --git a/src/index.js b/src/index.js index c4d951a4..39d129d4 100644 --- a/src/index.js +++ b/src/index.js @@ -3,7 +3,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { BrowserRouter } from 'react-router-dom'; -import { applyMiddleware, createStore } from 'redux'; +import { applyMiddleware, compose, createStore } from 'redux'; import ReduxThunk from 'redux-thunk'; import App from './App'; @@ -11,7 +11,12 @@ import './index.scss'; import reducers from './reducers'; import registerServiceWorker from './registerServiceWorker'; -const store = createStore(reducers, applyMiddleware(ReduxThunk)); +const composeEnhancers = process.env.NODE_ENV !== 'production' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ + ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ + : compose; +const store = createStore(reducers, composeEnhancers( + applyMiddleware(ReduxThunk) +)); ReactDOM.render( diff --git a/src/short-urls/reducers/shortUrlsList.js b/src/short-urls/reducers/shortUrlsList.js index 674f1c1a..f9771eae 100644 --- a/src/short-urls/reducers/shortUrlsList.js +++ b/src/short-urls/reducers/shortUrlsList.js @@ -5,7 +5,7 @@ const LIST_SHORT_URLS_ERROR = 'shlink/shortUrlsList/LIST_SHORT_URLS_ERROR'; export const LIST_SHORT_URLS = 'shlink/shortUrlsList/LIST_SHORT_URLS'; const initialState = { - shortUrls: [], + shortUrls: {}, loading: true, }; diff --git a/src/short-urls/reducers/shortUrlsListParams.js b/src/short-urls/reducers/shortUrlsListParams.js index c99bb38b..3217167d 100644 --- a/src/short-urls/reducers/shortUrlsListParams.js +++ b/src/short-urls/reducers/shortUrlsListParams.js @@ -2,7 +2,7 @@ import { LIST_SHORT_URLS } from './shortUrlsList'; const RESET_SHORT_URL_PARAMS = 'shlink/shortUrlsListParams/RESET_SHORT_URL_PARAMS'; -const defaultState = { page: 1 }; +const defaultState = { page: '1' }; export default function reducer(state = defaultState, action) { switch (action.type) {