forked from JSKitty/scc-web3
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ledger account index in advanced settings
- Loading branch information
Showing
8 changed files
with
89 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<script setup> | ||
import { useSettings } from '../composables/use_settings'; | ||
import { ref, watch } from 'vue'; | ||
import { storeToRefs } from 'pinia'; | ||
const settings = useSettings(); | ||
const { accountIndex, advancedMode } = storeToRefs(settings); | ||
const accountIndexStr = ref(settings.accountIndex.toString()); | ||
watch(advancedMode, (advancedMode) => { | ||
if (!advancedMode) { | ||
accountIndex.value = 0; | ||
} | ||
}); | ||
watch(accountIndex, () => { | ||
accountIndexStr.value = settings.accountIndex.toString(); | ||
}); | ||
watch(accountIndexStr, () => { | ||
accountIndexStr.value = accountIndexStr.value | ||
.toString() | ||
.replace(/[^0-9]/, ''); | ||
const accountIndex = Number.parseInt(accountIndexStr.value); | ||
if (accountIndex > 255) { | ||
accountIndexStr.value = '255'; | ||
} | ||
}); | ||
function setAccountIndex() { | ||
accountIndex.value = Number.parseInt(accountIndexStr.value) || 0; | ||
} | ||
</script> | ||
|
||
<template> | ||
<div v-if="settings.advancedMode"> | ||
<hr /> | ||
<div style="display: flex"> | ||
<label style="" for="accountIndex"> | ||
Choose a custom account index for ledger wallets. | ||
</label> | ||
<input | ||
id="accountIndex" | ||
v-model="accountIndexStr" | ||
@change="setAccountIndex()" | ||
min="0" | ||
max="255" | ||
/> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters