Files
chia-blockchain/electron-react/src/modules/mnemonic_input.js
T
700eaad9e0 Ms.1.8bugs3 (#326)
* harvester fixes
* Improve networking stability
* Fix wallet shutdown
* Allow chia keys sign and chia keys verify
* Dislpay the public key also
* Retry loading invalid plots, handle drive disconnection
* Confirm before deleting plots
* Improve error message WIP
* XImproved error message for importing keys
* Uncomment process.kill
* Fix merge error with restore backup
* Fixed markdown
* Switch button order, and fix request_peers
* Consolidate styles
* Set ci's to timeout after 60 minutes has elapsed
* plot directories and memory buffer
* Fix flake8
* Update chiapos, chiavdf, chiabip158, and blspy

Co-authored-by: Gene Hoffman <hoffmang@hoffmang.com>
Co-authored-by: Gene Hoffman <30377676+hoffmang9@users.noreply.github.com>
2020-07-27 16:01:18 -07:00

35 lines
1010 B
JavaScript

export const wordChanged = msg => ({ type: "MNEMONIC_TYPING" });
export const resetMnemonic = msg => ({ type: "RESET_MNEMONIC" });
export const setIncorrectWord = word => ({ type: "SET_INCORRECT_WORD", word });
const initial_state = {
mnemonic_input: new Array(24).fill(""),
incorrect_word: null
};
export const mnemonic_word_added = data => {
var action = wordChanged();
action.data = data;
return action;
};
export const mnemonicReducer = (state = { ...initial_state }, action) => {
switch (action.type) {
case "MNEMONIC_TYPING":
var word = action.data.word;
var id = action.data.id;
var current_input = state.mnemonic_input;
current_input[id] = word;
return { ...state, mnemonic_input: current_input };
case "RESET_MNEMONIC":
return {
mnemonic_input: new Array(24).fill(""),
incorrect_word: null
};
case "SET_INCORRECT_WORD":
return { ...state, incorrect_word: action.word };
default:
return state;
}
};