diff --git a/js/modules/signal.js b/js/modules/signal.js index 94a80a616b7..5b046516dc9 100644 --- a/js/modules/signal.js +++ b/js/modules/signal.js @@ -73,7 +73,6 @@ const updatesDuck = require('../../ts/state/ducks/updates'); const userDuck = require('../../ts/state/ducks/user'); const conversationsSelectors = require('../../ts/state/selectors/conversations'); -const registrationSelectors = require('../../ts/state/selectors/registration'); const searchSelectors = require('../../ts/state/selectors/search'); // Migrations @@ -311,7 +310,6 @@ exports.setup = (options = {}) => { const Selectors = { conversations: conversationsSelectors, - registration: registrationSelectors, search: searchSelectors, }; diff --git a/ts/state/selectors/network.ts b/ts/state/selectors/network.ts index 8a169f7e27e..22dc26fc0c9 100644 --- a/ts/state/selectors/network.ts +++ b/ts/state/selectors/network.ts @@ -2,7 +2,7 @@ import { createSelector } from 'reselect'; import { StateType } from '../reducer'; import { NetworkStateType } from '../ducks/network'; -import { isDone } from './registration'; +import { isDone } from '../../util/registration'; const getNetwork = (state: StateType): NetworkStateType => state.network; diff --git a/ts/state/selectors/registration.ts b/ts/state/selectors/registration.ts deleted file mode 100644 index 3b8bc66e9bf..00000000000 --- a/ts/state/selectors/registration.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { createSelector } from 'reselect'; - -import { StateType } from '../reducer'; -import { ItemsStateType } from '../ducks/items'; - -const getItems = (state: StateType): ItemsStateType => state.items; - -export const isDone = createSelector( - getItems, - (state: ItemsStateType): boolean => state.chromiumRegistrationDone === '' -); - -export const everDone = createSelector( - getItems, - (state: ItemsStateType): boolean => - state.chromiumRegistrationDoneEver === '' || - state.chromiumRegistrationDone === '' -); diff --git a/ts/state/smart/NetworkStatus.tsx b/ts/state/smart/NetworkStatus.tsx index 2445517c0d2..89ecff0309c 100644 --- a/ts/state/smart/NetworkStatus.tsx +++ b/ts/state/smart/NetworkStatus.tsx @@ -4,14 +4,14 @@ import { NetworkStatus } from '../../components/NetworkStatus'; import { StateType } from '../reducer'; import { getIntl } from '../selectors/user'; import { hasNetworkDialog } from '../selectors/network'; -import { isDone } from '../selectors/registration'; +import { isDone } from '../../util/registration'; const mapStateToProps = (state: StateType) => { return { ...state.network, hasNetworkDialog: hasNetworkDialog(state), i18n: getIntl(state), - isRegistrationDone: isDone(state), + isRegistrationDone: isDone(), }; }; diff --git a/ts/util/registration.ts b/ts/util/registration.ts index a45c5beac4c..b77742dd3e6 100644 --- a/ts/util/registration.ts +++ b/ts/util/registration.ts @@ -1,5 +1,3 @@ -import * as RegistrationSelectors from '../state/selectors/registration'; - export function markEverDone() { // @ts-ignore window.storage.put('chromiumRegistrationDoneEver', ''); @@ -18,10 +16,12 @@ export function remove() { export function isDone() { // @ts-ignore - return RegistrationSelectors.isDone(window.reduxStore.getState()); + // tslint:disable-next-line no-backbone-get-set-outside-model + return window.storage.get('chromiumRegistrationDone') === ''; } export function everDone() { // @ts-ignore - return RegistrationSelectors.everDone(window.reduxStore.getState()); + // tslint:disable-next-line no-backbone-get-set-outside-model + return window.storage.get('chromiumRegistrationDoneEver') === '' || isDone(); }