コード例 #1
0
ファイル: i18n.js プロジェクト: fendouai/jwallet-web
function onSetLanguage({ languageCode }) {
  storage.setI18n(languageCode)

  gtm.pushChangeLanguage(languageCode)

  const { origin, pathname } = window.location
  window.location.href = `${origin}${pathname}?lang=${languageCode}`
}
コード例 #2
0
ファイル: networks.js プロジェクト: fendouai/jwallet-web
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
  }
}
コード例 #3
0
ファイル: currencies.js プロジェクト: fendouai/jwallet-web
function* onAddCustomTokenSuccess() {
  gtm.pushAddCustomToken()
  yield put({ type: CUSTOM_TOKEN_CLEAR })
}
コード例 #4
0
function onOpenBackupKeystoreModal() {
  gtm.pushBackupKeystore('Open')
}
コード例 #5
0
function* onBackupKeystoreSuccess() {
  gtm.pushBackupKeystore('Success')
  yield put({ type: BACKUP_KEYSTORE.CLOSE_MODAL })
}