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.
This commit is contained in:
parent
2219298501
commit
59db39d4d9
|
@ -1,7 +1,7 @@
|
|||
// @flow
|
||||
|
||||
import { SET_CONFIG } from '../base/config';
|
||||
import { ADD_KNOWN_DOMAINS, addKnownDomains } from '../base/known-domains';
|
||||
import { ADD_KNOWN_DOMAINS } from '../base/known-domains';
|
||||
import { equals, MiddlewareRegistry } from '../base/redux';
|
||||
import { APP_STATE_CHANGED } from '../mobile/background/actionTypes';
|
||||
|
||||
|
@ -37,18 +37,6 @@ isCalendarEnabled()
|
|||
case SET_CONFIG: {
|
||||
const result = next(action);
|
||||
|
||||
// For legacy purposes, we've allowed the deserialization of
|
||||
// knownDomains and now we're to translate it to base/known-domains.
|
||||
const state = store.getState()['features/calendar-sync'];
|
||||
|
||||
if (state) {
|
||||
const { knownDomains } = state;
|
||||
|
||||
Array.isArray(knownDomains)
|
||||
&& knownDomains.length
|
||||
&& store.dispatch(addKnownDomains(knownDomains));
|
||||
}
|
||||
|
||||
_fetchCalendarEntries(store, false, false);
|
||||
|
||||
return result;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @flow
|
||||
|
||||
import { APP_WILL_MOUNT } from '../base/app';
|
||||
import { ReducerRegistry, set } from '../base/redux';
|
||||
import { PersistenceRegistry } from '../base/storage';
|
||||
|
||||
|
@ -41,33 +40,19 @@ const DEFAULT_STATE = {
|
|||
const STORE_NAME = 'features/calendar-sync';
|
||||
|
||||
/**
|
||||
* NOTE 1: For legacy purposes, read any {@code knownDomains} persisted by the
|
||||
* feature calendar-sync.
|
||||
*
|
||||
* NOTE 2: Never persist the authorization value as it's needed to remain a
|
||||
* NOTE: Never persist the authorization value as it's needed to remain a
|
||||
* runtime value to see if we need to re-request the calendar permission from
|
||||
* the user.
|
||||
*/
|
||||
isCalendarEnabled()
|
||||
&& PersistenceRegistry.register(STORE_NAME, {
|
||||
integrationType: true,
|
||||
knownDomains: true,
|
||||
msAuthState: true
|
||||
});
|
||||
|
||||
isCalendarEnabled()
|
||||
&& ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STATE, action) => {
|
||||
switch (action.type) {
|
||||
case APP_WILL_MOUNT:
|
||||
// For legacy purposes, we've allowed the deserialization of
|
||||
// knownDomains. At this point, it should have already been
|
||||
// translated into the new state format (namely, base/known-domains)
|
||||
// and the app no longer needs it.
|
||||
if (typeof state.knownDomains !== 'undefined') {
|
||||
return set(state, 'knownDomains', undefined);
|
||||
}
|
||||
break;
|
||||
|
||||
case CLEAR_CALENDAR_INTEGRATION:
|
||||
return DEFAULT_STATE;
|
||||
|
||||
|
|
Loading…
Reference in New Issue