diff options
| author | Erik Larkö <erik@mullvad.net> | 2017-07-07 12:52:46 +0200 |
|---|---|---|
| committer | Erik Larkö <erik@mullvad.net> | 2017-07-07 16:29:02 +0200 |
| commit | ea25ebc2cdf38fd128a817072e34a0518ea0417c (patch) | |
| tree | 32717a8b1f05a2adf6a04955c39657988dadeaee | |
| parent | 3d74d593111953ba7e79eed62447edbb054a9fca (diff) | |
| download | mullvadvpn-ea25ebc2cdf38fd128a817072e34a0518ea0417c.tar.xz mullvadvpn-ea25ebc2cdf38fd128a817072e34a0518ea0417c.zip | |
Remove persistent storage
| -rw-r--r-- | app/app.js | 18 | ||||
| -rw-r--r-- | app/redux/store.js | 3 | ||||
| -rw-r--r-- | package.json | 1 | ||||
| -rw-r--r-- | test/helpers/ipc-helpers.js | 5 | ||||
| -rw-r--r-- | yarn.lock | 4 |
5 files changed, 1 insertions, 30 deletions
diff --git a/app/app.js b/app/app.js index f829e4bd29..7710ff1acf 100644 --- a/app/app.js +++ b/app/app.js @@ -10,11 +10,8 @@ import { webFrame, ipcRenderer } from 'electron'; import log from 'electron-log'; import makeRoutes from './routes'; import configureStore from './redux/store'; -import accountActions from './redux/account/actions'; -import connectionActions from './redux/connection/actions'; import { Backend } from './lib/backend'; -import type { LoginState } from './redux/account/reducers'; import type { ConnectionState } from './redux/connection/reducers'; import type { TrayIconType } from './lib/tray-icon-manager'; @@ -64,21 +61,6 @@ updateTrayIcon(); ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// -// reset login state if user quit the app during login -if((['logging in', 'failed']: Array<LoginState>).includes(store.getState().account.status)) { - store.dispatch(accountActions.loginChange({ - status: 'none' - })); -} - -// reset connection state if user quit the app when logging in -if(store.getState().connection.status === 'logging in') { - store.dispatch(connectionActions.connectionChange({ - status: 'disconnected' - })); -} - - // disable smart pinch. webFrame.setZoomLevelLimits(1, 1); diff --git a/app/redux/store.js b/app/redux/store.js index 2f08a462eb..5d12d9af6c 100644 --- a/app/redux/store.js +++ b/app/redux/store.js @@ -1,7 +1,6 @@ // @flow import { createStore, applyMiddleware, combineReducers, compose } from 'redux'; import { routerMiddleware, routerReducer, push, replace } from 'react-router-redux'; -import persistState from 'redux-localstorage'; import thunk from 'redux-thunk'; import account from './account/reducers.js'; @@ -52,7 +51,7 @@ export default function configureStore(initialState: ?ReduxState, routerHistory: return compose; })(); - const enhancer = composeEnhancers(applyMiddleware(...middlewares), persistState()); + const enhancer = composeEnhancers(applyMiddleware(...middlewares)); const rootReducer = combineReducers(reducers); if(initialState) { return createStore(rootReducer, initialState, enhancer); diff --git a/package.json b/package.json index b9124b7bf0..7109c51416 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "react-transition-group": "^1.2.0", "redux": "^3.0.0", "redux-actions": "^2.0.1", - "redux-localstorage": "^0.4.1", "redux-thunk": "^2.2.0", "uuid": "^3.0.1", "validated": "^1.1.0" diff --git a/test/helpers/ipc-helpers.js b/test/helpers/ipc-helpers.js index b32c1e5b69..5e4b2941d6 100644 --- a/test/helpers/ipc-helpers.js +++ b/test/helpers/ipc-helpers.js @@ -9,11 +9,6 @@ import { mockState, mockStore } from '../mocks/redux'; type DoneCallback = (?mixed) => void; type Check = () => void; -// Mock localStorage because redux-localstorage has no test helpers -// We use redux-localstorage when we setup the redux store to have the -// store persist when the application is shut down. -global.localStorage = {getItem: ()=>'{}', setItem: ()=>{}}; - export function setupBackendAndStore() { const memoryHistory = createMemoryHistory(); @@ -4708,10 +4708,6 @@ redux-actions@^2.0.1: lodash-es "^4.17.4" reduce-reducers "^0.1.0" -redux-localstorage@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/redux-localstorage/-/redux-localstorage-0.4.1.tgz#faf6d719c581397294d811473ffcedee065c933c" - redux-mock-store@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/redux-mock-store/-/redux-mock-store-1.2.3.tgz#1b3ad299da91cb41ba30d68e3b6f024475fb9e1b" |
