How to use the react-native-config.DEFAULT_PIN function in react-native-config

To help you get started, we’ve selected a few react-native-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github esteemapp / esteem-mobile / src / screens / application / container / applicationContainer.js View on Github external
if (realmData.length > 0) {
      const realmObject = realmData.filter(data => data.username === currentUsername);

      if (realmObject.length === 0) {
        realmObject[0] = realmData[realmData.length - 1];
        // TODO:
        await switchAccount(realmObject[0].username);
      }
      const isExistUser = await getExistUser();

      realmObject[0].name = currentUsername;
      // If in dev mode pin code does not show
      if ((!isExistUser || !pinCode) && _isPinCodeOpen) {
        dispatch(openPinCodeModal());
      } else if (!_isPinCodeOpen) {
        const encryptedPin = encryptKey(Config.DEFAULT_PIN, Config.PIN_KEY);
        dispatch(savePinCode(encryptedPin));
      }

      dispatch(activeApplication());
      dispatch(isLoginDone());
      dispatch(login(true));

      return realmObject[0];
    }

    dispatch(updateCurrentAccount({}));
    dispatch(activeApplication());
    dispatch(isLoginDone());

    return null;
  };
github esteemapp / esteem-mobile / src / screens / settings / container / settingsContainer.js View on Github external
setTheme(action);
        break;

      case 'default_footer':
        dispatch(isDefaultFooter(action));
        // setDefaultFooter(action);
        break;

      case 'pincode':
        if (action) {
          dispatch(
            openPinCodeModal({
              callback: () => this._setDefaultPinCode(action),
              isReset: true,
              isOldPinVerified: true,
              oldPinCode: Config.DEFAULT_PIN,
            }),
          );
        } else {
          dispatch(
            openPinCodeModal({
              callback: () => this._setDefaultPinCode(action),
            }),
          );
        }
        break;
      default:
        break;
    }
  };
github esteemapp / esteem-mobile / src / screens / login / container / loginContainer.js View on Github external
.then(result => {
        if (result) {
          dispatch(updateCurrentAccount({ ...result }));
          dispatch(addOtherAccount({ username: result.name }));
          dispatch(loginAction(true));
          userActivity(result.name, 20);
          this._setPushToken(result.name);
          if (isPinCodeOpen) {
            dispatch(openPinCodeModal({ navigateTo: ROUTES.DRAWER.MAIN }));
          } else {
            const encryptedPin = encryptKey(Config.DEFAULT_PIN, Config.PIN_KEY);
            dispatch(setPinCode(encryptedPin));
            navigation.navigate({
              routeName: ROUTES.DRAWER.MAIN,
            });
          }
        }
      })
      .catch(err => {
github esteemapp / esteem-mobile / src / screens / settings / container / settingsContainer.js View on Github external
updatePinCode(pinData).then(response => {
        const _currentAccount = currentAccount;
        _currentAccount.local = response;

        dispatch(updateCurrentAccount({ ..._currentAccount }));

        const encryptedPin = encryptKey(Config.DEFAULT_PIN, Config.PIN_KEY);
        dispatch(savePinCode(encryptedPin));

        setPinCodeOpen(action);
        dispatch(isPinCodeOpen(action));
      });
    } else {
github esteemapp / esteem-mobile / src / screens / settings / container / settingsContainer.js View on Github external
_setDefaultPinCode = action => {
    const { dispatch, username, currentAccount, pinCode } = this.props;

    if (!action) {
      const oldPinCode = decryptKey(pinCode, Config.PIN_KEY);
      const pinData = {
        pinCode: Config.DEFAULT_PIN,
        username,
        oldPinCode,
      };
      updatePinCode(pinData).then(response => {
        const _currentAccount = currentAccount;
        _currentAccount.local = response;

        dispatch(updateCurrentAccount({ ..._currentAccount }));

        const encryptedPin = encryptKey(Config.DEFAULT_PIN, Config.PIN_KEY);
        dispatch(savePinCode(encryptedPin));

        setPinCodeOpen(action);
        dispatch(isPinCodeOpen(action));
      });
    } else {