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

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

1
 // @flow
1
 // @flow
2
 
2
 
3
 import { SET_CONFIG } from '../base/config';
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
 import { equals, MiddlewareRegistry } from '../base/redux';
5
 import { equals, MiddlewareRegistry } from '../base/redux';
6
 import { APP_STATE_CHANGED } from '../mobile/background/actionTypes';
6
 import { APP_STATE_CHANGED } from '../mobile/background/actionTypes';
7
 
7
 
37
         case SET_CONFIG: {
37
         case SET_CONFIG: {
38
             const result = next(action);
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
             _fetchCalendarEntries(store, false, false);
40
             _fetchCalendarEntries(store, false, false);
53
 
41
 
54
             return result;
42
             return result;

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

1
 // @flow
1
 // @flow
2
 
2
 
3
-import { APP_WILL_MOUNT } from '../base/app';
4
 import { ReducerRegistry, set } from '../base/redux';
3
 import { ReducerRegistry, set } from '../base/redux';
5
 import { PersistenceRegistry } from '../base/storage';
4
 import { PersistenceRegistry } from '../base/storage';
6
 
5
 
41
 const STORE_NAME = 'features/calendar-sync';
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
  * runtime value to see if we need to re-request the calendar permission from
44
  * runtime value to see if we need to re-request the calendar permission from
49
  * the user.
45
  * the user.
50
  */
46
  */
51
 isCalendarEnabled()
47
 isCalendarEnabled()
52
     && PersistenceRegistry.register(STORE_NAME, {
48
     && PersistenceRegistry.register(STORE_NAME, {
53
         integrationType: true,
49
         integrationType: true,
54
-        knownDomains: true,
55
         msAuthState: true
50
         msAuthState: true
56
     });
51
     });
57
 
52
 
58
 isCalendarEnabled()
53
 isCalendarEnabled()
59
     && ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STATE, action) => {
54
     && ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STATE, action) => {
60
         switch (action.type) {
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
         case CLEAR_CALENDAR_INTEGRATION:
56
         case CLEAR_CALENDAR_INTEGRATION:
72
             return DEFAULT_STATE;
57
             return DEFAULT_STATE;
73
 
58
 

Loading…
Cancel
Save