2020-10-02 17:03:25 +02:00
|
|
|
import { createSelector } from 'reselect';
|
|
|
|
|
2022-10-25 21:24:06 +02:00
|
|
|
const selectState = (state) => state.sync || {};
|
2020-10-02 17:03:25 +02:00
|
|
|
|
2022-10-25 21:24:06 +02:00
|
|
|
export const selectHasSyncedWallet = createSelector(selectState, (state) => state.hasSyncedWallet);
|
2020-10-02 17:03:25 +02:00
|
|
|
|
2022-10-25 21:24:06 +02:00
|
|
|
export const selectSyncHash = createSelector(selectState, (state) => state.syncHash);
|
2020-10-02 17:03:25 +02:00
|
|
|
|
2022-10-25 21:24:06 +02:00
|
|
|
export const selectSyncData = createSelector(selectState, (state) => state.syncData);
|
2020-10-02 17:03:25 +02:00
|
|
|
|
2022-10-25 21:24:06 +02:00
|
|
|
export const selectSetSyncErrorMessage = createSelector(selectState, (state) => state.setSyncErrorMessage);
|
2020-10-02 17:03:25 +02:00
|
|
|
|
2022-10-25 21:24:06 +02:00
|
|
|
export const selectGetSyncErrorMessage = createSelector(selectState, (state) => state.getSyncErrorMessage);
|
2020-10-02 17:03:25 +02:00
|
|
|
|
2022-10-25 21:24:06 +02:00
|
|
|
export const selectGetSyncIsPending = createSelector(selectState, (state) => state.getSyncIsPending);
|
2020-10-02 17:03:25 +02:00
|
|
|
|
2022-10-25 21:24:06 +02:00
|
|
|
export const selectSetSyncIsPending = createSelector(selectState, (state) => state.setSyncIsPending);
|
2020-10-02 17:03:25 +02:00
|
|
|
|
2022-10-25 21:24:06 +02:00
|
|
|
export const selectHashChanged = createSelector(selectState, (state) => state.hashChanged);
|
2020-10-02 17:03:25 +02:00
|
|
|
|
2022-10-25 21:24:06 +02:00
|
|
|
export const selectSyncApplyIsPending = createSelector(selectState, (state) => state.syncApplyIsPending);
|
2020-10-02 17:03:25 +02:00
|
|
|
|
2022-10-25 21:24:06 +02:00
|
|
|
export const selectSyncApplyErrorMessage = createSelector(selectState, (state) => state.syncApplyErrorMessage);
|
2020-10-02 17:03:25 +02:00
|
|
|
|
2022-10-25 21:24:06 +02:00
|
|
|
export const selectSyncApplyPasswordError = createSelector(selectState, (state) => state.syncApplyPasswordError);
|
2020-10-05 20:31:51 +02:00
|
|
|
|
2022-10-25 21:24:06 +02:00
|
|
|
export const selectSyncIsLocked = createSelector(selectState, (state) => state.syncLocked);
|
2020-10-05 20:31:51 +02:00
|
|
|
|
2022-10-25 21:24:06 +02:00
|
|
|
export const selectPrefsReady = createSelector(selectState, (state) => state.prefsReady);
|
2020-11-12 18:38:28 +01:00
|
|
|
|
2022-10-25 21:24:06 +02:00
|
|
|
export const selectSyncFatalError = createSelector(selectState, (state) => state.fatalError);
|
2022-10-07 22:18:45 +02:00
|
|
|
// lbrysync
|
|
|
|
|
2022-10-25 21:24:06 +02:00
|
|
|
// begin
|
|
|
|
export const selectLbrySyncCheckingEmail = createSelector(selectState, (state) => state.checkingEmail);
|
|
|
|
export const selectLbrySyncEmailError = createSelector(selectState, (state) => state.emailError);
|
|
|
|
export const selectLbrySyncEmail = createSelector(selectState, (state) => state.registeredEmail);
|
|
|
|
export const selectLbrySyncEmailCandidate = createSelector(selectState, (state) => state.candidateEmail);
|
2022-10-07 22:18:45 +02:00
|
|
|
export const selectLbrySyncGettingSalt = createSelector(selectState, (state) => state.gettingSalt);
|
|
|
|
export const selectLbrySyncSaltError = createSelector(selectState, (state) => state.saltError);
|
|
|
|
export const selectLbrySyncSaltSeed = createSelector(selectState, (state) => state.saltSeed);
|
2022-10-25 21:24:06 +02:00
|
|
|
// password
|
2022-10-07 22:18:45 +02:00
|
|
|
export const selectLbrySyncDerivingKeys = createSelector(selectState, (state) => state.derivingKeys);
|
|
|
|
export const selectLbrySyncEncryptedHmacKey = createSelector(selectState, (state) => state.encryptedHmacKey);
|
|
|
|
export const selectLbrySyncEncryptedRoot = createSelector(selectState, (state) => state.encryptedRoot);
|
|
|
|
export const selectLbrySyncEncryptedProviderPass = createSelector(selectState, (state) => state.encryptedProviderPass);
|
2022-10-25 21:24:06 +02:00
|
|
|
// register
|
|
|
|
export const selectLbrySyncRegistering = createSelector(selectState, (state) => state.registering);
|
|
|
|
export const selectLbrySyncRegisterError = createSelector(selectState, (state) => state.registerError);
|
|
|
|
// auth
|
|
|
|
export const selectLbrySyncIsAuthenticating = createSelector(selectState, (state) => state.isAuthenticating);
|
|
|
|
|
|
|
|
export const selectLbrySyncAuthError = createSelector(selectState, (state) => state.authError);
|
|
|
|
|
|
|
|
export const selectLbrySyncToken = createSelector(selectState, (state) => state.authToken);
|
|
|
|
// push/pull?
|