diff --git a/src/renderer/components/password-dialog/password-dialog.css b/src/renderer/components/password-dialog/password-dialog.css index 8769c42f1af6d..2d37968aabcaf 100644 --- a/src/renderer/components/password-dialog/password-dialog.css +++ b/src/renderer/components/password-dialog/password-dialog.css @@ -1,10 +1,9 @@ .card { - position: relative; - width: 85%; - height: 25%; - margin: auto; - box-sizing: border-box; + width: 85%; + margin: auto; + box-sizing: border-box; } + .passwordInput { - width: 100%; + width: 100%; } diff --git a/src/renderer/components/password-dialog/password-dialog.js b/src/renderer/components/password-dialog/password-dialog.js index 1e2212157147d..b201e57c3fee2 100644 --- a/src/renderer/components/password-dialog/password-dialog.js +++ b/src/renderer/components/password-dialog/password-dialog.js @@ -1,58 +1,27 @@ import Vue from 'vue' -import { mapActions } from 'vuex' import FtCard from '../ft-card/ft-card.vue' import FtInput from '../ft-input/ft-input.vue' -import FtFlexBox from '../ft-flex-box/ft-flex-box.vue' -import FtPrompt from '../ft-prompt/ft-prompt.vue' export default Vue.extend({ name: 'PasswordDialog', components: { 'ft-input': FtInput, - 'ft-card': FtCard, - 'ft-flex-box': FtFlexBox, - 'ft-prompt': FtPrompt, - }, - emits: ['settingsUnlocked'], - data: function() { - return { - password: '', - showIncorrectPassword: false - } + 'ft-card': FtCard }, + emits: ['unlocked'], computed: { - getStoredPassword: function() { + settingsPassword: function () { return this.$store.getters.getSettingsPassword - }, - incorrectPassword: function() { - return this.password !== '' && !this.unlocked - }, - unlocked: function() { - return this.getStoredPassword === '' || this.password === this.getStoredPassword } }, - watch: { - unlocked(val, oldVal) { - if (val !== oldVal) { - this.propagateUnlockStatus() - } - }, - }, mounted: function () { - this.propagateUnlockStatus() this.$refs.password.focus() }, methods: { - handleLock: function () { - this.password = '' - this.showIncorrectPassword = false - }, - propagateUnlockStatus: function() { - this.$emit('settingsUnlocked', this.unlocked) - }, - ...mapActions([ - 'updateSettingsPassword' - ]), - + handlePasswordInput: function (input) { + if (input === this.settingsPassword) { + this.$emit('unlocked') + } + } } }) diff --git a/src/renderer/components/password-dialog/password-dialog.vue b/src/renderer/components/password-dialog/password-dialog.vue index f7b6300d15845..89858f2106e8a 100644 --- a/src/renderer/components/password-dialog/password-dialog.vue +++ b/src/renderer/components/password-dialog/password-dialog.vue @@ -1,30 +1,18 @@