-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement modal to reset wallet backend
- Loading branch information
Showing
16 changed files
with
261 additions
and
15 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,60 @@ | ||
<template> | ||
<Card | ||
class="card" | ||
:title="$t('reset_wallet_files')" | ||
:border="true" | ||
type="danger" | ||
shadow="thin" | ||
> | ||
<p class="text"> | ||
<span class="bold">{{ $t('please_note').toUpperCase() }}</span> | ||
{{ $t('delete_wallet_files_info') }} | ||
</p> | ||
<div class="btn-container"> | ||
<el-button | ||
type="danger" | ||
class="delete" | ||
@click="showDeleteWalletFilesModal" | ||
> | ||
{{ $t('delete_wallet_files_action') }} | ||
</el-button> | ||
</div> | ||
</Card> | ||
</template> | ||
|
||
<script> | ||
import { mapMutations } from 'vuex' | ||
import Card from '@/components/card/Card.vue' | ||
export default { | ||
name: 'SettingsOptionCurrenty', | ||
components: { Card }, | ||
methods: { | ||
...mapMutations({ | ||
showDeleteWalletFilesModal: 'showDeleteWalletFilesModal', | ||
}), | ||
}, | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
@import '@/styles/_colors.scss'; | ||
.card { | ||
.content { | ||
border-radius: 4px; | ||
} | ||
.bold { | ||
font-weight: bold; | ||
} | ||
.btn-container { | ||
margin-top: 32px; | ||
text-align: right; | ||
width: 100%; | ||
display: flex; | ||
justify-content: flex-end; | ||
} | ||
} | ||
</style> |
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,136 @@ | ||
<template> | ||
<el-dialog | ||
v-model="isDeleteWalletFilesModalVisibleLocal" | ||
class="delete" | ||
:show-close="true" | ||
@close="close" | ||
> | ||
<template #header> | ||
<div class="title-container"> | ||
<font-awesome-icon class="icon" icon="exclamation-triangle" /> | ||
<p class="title">{{ $t('warning') }}</p> | ||
</div> | ||
</template> | ||
<p class="text"> | ||
{{ $t('delete_files_confirmation_0') }} | ||
</p> | ||
<p class="text"> | ||
{{ $t('delete_files_confirmation_1') }} | ||
</p> | ||
<p class="text"> | ||
{{ $t('delete_files_confirmation_2') }} | ||
</p> | ||
<template #footer> | ||
<div class="dialog-footer"> | ||
<el-button type="danger" plain @click="close">{{ | ||
$t('cancel') | ||
}}</el-button> | ||
<el-button type="danger" @click="callDelete">{{ | ||
$t('delete_wallet_files_action') | ||
}}</el-button> | ||
</div> | ||
</template> | ||
</el-dialog> | ||
</template> | ||
|
||
<script> | ||
import { mapState, mapActions, mapMutations, mapGetters } from 'vuex' | ||
export default { | ||
name: 'DeleteConfirmation', | ||
data() { | ||
return { | ||
error: null, | ||
walletName: '', | ||
} | ||
}, | ||
computed: { | ||
...mapState({ | ||
isDeleteWalletFilesModalVisible: state => { | ||
return state.uiInteractions.isDeleteWalletFilesModalVisible | ||
}, | ||
}), | ||
...mapGetters(['unlockedWallet']), | ||
validateDelete() { | ||
return this.walletName === this.unlockedWallet.name | ||
}, | ||
isDeleteWalletFilesModalVisibleLocal: { | ||
set() { | ||
this.$emit('close') | ||
}, | ||
get() { | ||
return this.isDeleteWalletFilesModalVisible | ||
}, | ||
}, | ||
}, | ||
watch: { | ||
walletName() { | ||
this.clearDeleteWalletError() | ||
}, | ||
}, | ||
beforeUnmount() { | ||
this.error = null | ||
}, | ||
methods: { | ||
...mapActions({ | ||
deleteWalletFiles: 'deleteWalletFiles', | ||
}), | ||
...mapMutations({ | ||
close: 'closeDeleteWalletFilesModal', | ||
}), | ||
clearDeleteWalletError() { | ||
this.error = null | ||
}, | ||
callDelete() { | ||
this.deleteWalletFiles() | ||
this.close() | ||
}, | ||
}, | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
@import '@/styles/_colors.scss'; | ||
.delete { | ||
.title-container { | ||
align-items: center; | ||
color: $red-2; | ||
display: flex; | ||
.title { | ||
color: $red-2; | ||
font-size: 32px; | ||
} | ||
.icon { | ||
font-size: 36px; | ||
margin-right: 8px; | ||
} | ||
} | ||
.el-dialog__body { | ||
padding: 10px 20px; | ||
word-break: break-word; | ||
.input { | ||
margin: 8px 0; | ||
} | ||
.error { | ||
color: $red-2; | ||
font-size: 14px; | ||
margin-top: 8px; | ||
} | ||
.text { | ||
margin-bottom: 8px; | ||
.wallet-name { | ||
color: var(--primary-color); | ||
font-family: 'Roboto Mono'; | ||
} | ||
} | ||
} | ||
} | ||
</style> |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
const { sendShutdownFinished } = window['ipcAPI'] | ||
const { sendShutdownFinished, sendClearWalletFiles } = window['ipcAPI'] | ||
|
||
export { sendShutdownFinished } | ||
export { sendShutdownFinished, sendClearWalletFiles } |
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
Oops, something went wrong.