Exemple #1
0
function onSetLanguage({ languageCode }) {
  storage.setI18n(languageCode)

  gtm.pushChangeLanguage(languageCode)

  const { origin, pathname } = window.location
  window.location.href = `${origin}${pathname}?lang=${languageCode}`
}
Exemple #2
0
function* onSaveCustomNetwork({ customNetworkRpc, onSuccess, onError }) {
  const { items } = yield select(selectNetworks)

  try {
    checkCustomNetworkRpc(items, customNetworkRpc)

    const newCustomNetwork = parseCustomNetworkRpc(customNetworkRpc)
    const newItems = [...items, newCustomNetwork]
    const newCurrentNetworkIndex = newItems.length - 1

    yield setNetworks(newItems, newCurrentNetworkIndex)

    gtm.pushAddCustomNetwork()

    return onSuccess ? onSuccess() : null
  } catch (err) {
    return onError ? onError(err) : null
  }
}
Exemple #3
0
function* onAddCustomTokenSuccess() {
  gtm.pushAddCustomToken()
  yield put({ type: CUSTOM_TOKEN_CLEAR })
}
function onOpenBackupKeystoreModal() {
  gtm.pushBackupKeystore('Open')
}
function* onBackupKeystoreSuccess() {
  gtm.pushBackupKeystore('Success')
  yield put({ type: BACKUP_KEYSTORE.CLOSE_MODAL })
}