FIX: freeze label

This commit is contained in:
Ivan Vershigora 2020-10-29 22:34:06 +03:00
parent dc9e678dc4
commit 1508042cd7
2 changed files with 6 additions and 2 deletions

View file

@ -406,6 +406,7 @@
"change": "change",
"empty": "Wallet UTXO set is empty",
"freeze": "freeze",
"freezeLabel": "Freeze",
"header": "Coin control",
"useCoin": "Use coin"
}

View file

@ -113,7 +113,6 @@ const OutputModalContent = ({ output, wallet, onUseCoin }) => {
const { txMetadata, saveToDisk } = useContext(BlueStorageContext);
const [frozen, setFrozen] = useState(wallet.getUTXOMetadata(output.txid, output.vout).frozen || false);
const [memo, setMemo] = useState(wallet.getUTXOMetadata(output.txid, output.vout).memo || txMetadata[output.txid]?.memo || '');
const onFreeze = value => setFrozen(value);
const onMemoChange = value => setMemo(value);
// save on form change. Because effect called on each event, debounce it.
@ -145,7 +144,11 @@ const OutputModalContent = ({ output, wallet, onUseCoin }) => {
]}
onChangeText={onMemoChange}
/>
<BlueListItem title="Freeze" Component={TouchableWithoutFeedback} switch={{ value: frozen, onValueChange: onFreeze }} />
<BlueListItem
title={loc.cc.freezeLabel}
Component={TouchableWithoutFeedback}
switch={{ value: frozen, onValueChange: value => setFrozen(value) }}
/>
<BlueSpacing20 />
<BlueButton title={loc.cc.useCoin} onPress={() => onUseCoin([output])} />
</>