mg-library 1.0.368 → 1.0.370

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/login.js +1 -3
  2. package/package.json +1 -1
  3. package/reducers.js +4 -0
package/login.js CHANGED
@@ -11,9 +11,6 @@ export function onPressLogin(dispatch, actions, server, app, apiUrl, language, d
11
11
  password: data.password,
12
12
  language: mgConstantsLib.LANGUAGE_SPANISH
13
13
  }
14
-
15
- console.log(requestData);
16
-
17
14
  dispatch(actions.apiRequest());
18
15
  axios.post(apiUrl + '/Login', requestData, mgFunctionsLib.getRequestHeader())
19
16
  .then(response => {
@@ -53,6 +50,7 @@ export function onPressLogout(dispatch, actions, app, apiUrl) {
53
50
  axios.post(apiUrl + '/Logout', requestData, mgFunctionsLib.getRequestHeader())
54
51
  .then(response => {
55
52
  mgFunctionsLib.writeToLocalStorage(mgConstantsLib.ACCESS_TOKEN, '');
53
+ dispatch(actions.mgDisconnectFromServer());
56
54
  dispatch(actions.apiSuccess());
57
55
  })
58
56
  .catch(error => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mg-library",
3
- "version": "1.0.368",
3
+ "version": "1.0.370",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/reducers.js CHANGED
@@ -32,6 +32,10 @@ export const mgRingBell = (state) => {
32
32
  state.bell = !state.bell;
33
33
  }
34
34
 
35
+ export const mgDisconnectFromServer = (state) => {
36
+ state.server = undefined;
37
+ }
38
+
35
39
  export const mgLogin = (state, action) => {
36
40
  state.isLoggedIn = true;
37
41
  const { server, company, accessToken } = action.payload;