Browse Source

rn: cleanup old code

This legacy code was added about a year ago to ease the migration between
releases:
631f51d627

I consider this not to be needed anymore.
master
Saúl Ibarra Corretgé 6 years ago
parent
commit
59db39d4d9
2 changed files with 2 additions and 29 deletions
  1. 1
    13
      react/features/calendar-sync/middleware.js
  2. 1
    16
      react/features/calendar-sync/reducer.js

+ 1
- 13
react/features/calendar-sync/middleware.js View File

@@ -1,7 +1,7 @@
1 1
 // @flow
2 2
 
3 3
 import { SET_CONFIG } from '../base/config';
4
-import { ADD_KNOWN_DOMAINS, addKnownDomains } from '../base/known-domains';
4
+import { ADD_KNOWN_DOMAINS } from '../base/known-domains';
5 5
 import { equals, MiddlewareRegistry } from '../base/redux';
6 6
 import { APP_STATE_CHANGED } from '../mobile/background/actionTypes';
7 7
 
@@ -37,18 +37,6 @@ isCalendarEnabled()
37 37
         case SET_CONFIG: {
38 38
             const result = next(action);
39 39
 
40
-            // For legacy purposes, we've allowed the deserialization of
41
-            // knownDomains and now we're to translate it to base/known-domains.
42
-            const state = store.getState()['features/calendar-sync'];
43
-
44
-            if (state) {
45
-                const { knownDomains } = state;
46
-
47
-                Array.isArray(knownDomains)
48
-                    && knownDomains.length
49
-                    && store.dispatch(addKnownDomains(knownDomains));
50
-            }
51
-
52 40
             _fetchCalendarEntries(store, false, false);
53 41
 
54 42
             return result;

+ 1
- 16
react/features/calendar-sync/reducer.js View File

@@ -1,6 +1,5 @@
1 1
 // @flow
2 2
 
3
-import { APP_WILL_MOUNT } from '../base/app';
4 3
 import { ReducerRegistry, set } from '../base/redux';
5 4
 import { PersistenceRegistry } from '../base/storage';
6 5
 
@@ -41,33 +40,19 @@ const DEFAULT_STATE = {
41 40
 const STORE_NAME = 'features/calendar-sync';
42 41
 
43 42
 /**
44
- * NOTE 1: For legacy purposes, read any {@code knownDomains} persisted by the
45
- * feature calendar-sync.
46
- *
47
- * NOTE 2: Never persist the authorization value as it's needed to remain a
43
+ * NOTE: Never persist the authorization value as it's needed to remain a
48 44
  * runtime value to see if we need to re-request the calendar permission from
49 45
  * the user.
50 46
  */
51 47
 isCalendarEnabled()
52 48
     && PersistenceRegistry.register(STORE_NAME, {
53 49
         integrationType: true,
54
-        knownDomains: true,
55 50
         msAuthState: true
56 51
     });
57 52
 
58 53
 isCalendarEnabled()
59 54
     && ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STATE, action) => {
60 55
         switch (action.type) {
61
-        case APP_WILL_MOUNT:
62
-            // For legacy purposes, we've allowed the deserialization of
63
-            // knownDomains. At this point, it should have already been
64
-            // translated into the new state format (namely, base/known-domains)
65
-            // and the app no longer needs it.
66
-            if (typeof state.knownDomains !== 'undefined') {
67
-                return set(state, 'knownDomains', undefined);
68
-            }
69
-            break;
70
-
71 56
         case CLEAR_CALENDAR_INTEGRATION:
72 57
             return DEFAULT_STATE;
73 58
 

Loading…
Cancel
Save