# HG changeset patch # User ymh # Date 1497889947 -7200 # Node ID 2e4e9f9ebc4f6e58a20337533a3d5c5deff12f40 # Parent 96543c395baa6ba5b1935b5106dcd54ef97950c5 Take client from context diff -r 96543c395baa -r 2e4e9f9ebc4f client/src/sagas/index.js --- a/client/src/sagas/index.js Mon Jun 19 18:23:26 2017 +0200 +++ b/client/src/sagas/index.js Mon Jun 19 18:32:27 2017 +0200 @@ -100,7 +100,7 @@ try { const { username, password } = yield take(types.AUTH_LOGIN_REQUEST); - const client = context['client']; + const client = context.client; const response = yield client.post('/api/auth/login/', { username, password }); localStorage.setItem('currentUser', JSON.stringify(response.user)); @@ -135,9 +135,10 @@ } } -function* watchUpdateSettings() { +function* watchUpdateSettings(context) { while (true) { const { username, firstname, lastname } = yield take(types.USER_UPDATE_SETTINGS_ASYNC); + const client = context.client; try { yield client.put('/api/auth/user/', { username, @@ -163,6 +164,6 @@ watchLoginSubmit(), watchLoginRequest(context), watchStoreToken(), - watchUpdateSettings(), + watchUpdateSettings(context), ]) }