2020-11-25 12:31:34 +00:00
|
|
|
<template>
|
|
|
|
<FormBase>
|
|
|
|
<FormGroup>
|
|
|
|
<FormInput v-model:value="emailAddress" type="email">
|
2020-12-26 01:47:36 +00:00
|
|
|
{{ $ts.emailAddress }}
|
|
|
|
<template #desc v-if="$i.email && !$i.emailVerified">{{ $ts.verificationEmailSent }}</template>
|
|
|
|
<template #desc v-else-if="emailAddress === $i.email && $i.emailVerified">{{ $ts.emailVerified }}</template>
|
2020-11-25 12:31:34 +00:00
|
|
|
</FormInput>
|
|
|
|
</FormGroup>
|
2020-12-26 01:47:36 +00:00
|
|
|
<FormButton @click="save" primary>{{ $ts.save }}</FormButton>
|
2020-11-25 12:31:34 +00:00
|
|
|
</FormBase>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from 'vue';
|
|
|
|
import { faCog } from '@fortawesome/free-solid-svg-icons';
|
|
|
|
import { faBell, faEnvelope } from '@fortawesome/free-regular-svg-icons';
|
2021-03-23 08:30:14 +00:00
|
|
|
import FormButton from '@client/components/form/button.vue';
|
|
|
|
import FormInput from '@client/components/form/input.vue';
|
|
|
|
import FormBase from '@client/components/form/base.vue';
|
|
|
|
import FormGroup from '@client/components/form/group.vue';
|
|
|
|
import * as os from '@client/os';
|
2020-11-25 12:31:34 +00:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
|
|
|
FormBase,
|
|
|
|
FormInput,
|
|
|
|
FormButton,
|
|
|
|
FormGroup,
|
|
|
|
},
|
|
|
|
|
|
|
|
emits: ['info'],
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
INFO: {
|
2020-12-26 01:47:36 +00:00
|
|
|
title: this.$ts.emailAddress,
|
2020-11-25 12:31:34 +00:00
|
|
|
icon: faEnvelope
|
|
|
|
},
|
|
|
|
emailAddress: null,
|
|
|
|
code: null,
|
|
|
|
faCog
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
created() {
|
2020-12-19 01:55:52 +00:00
|
|
|
this.emailAddress = this.$i.email;
|
2020-11-25 12:31:34 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
this.$emit('info', this.INFO);
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
save() {
|
|
|
|
os.dialog({
|
2020-12-26 01:47:36 +00:00
|
|
|
title: this.$ts.password,
|
2020-11-25 12:31:34 +00:00
|
|
|
input: {
|
|
|
|
type: 'password'
|
|
|
|
}
|
|
|
|
}).then(({ canceled, result: password }) => {
|
|
|
|
if (canceled) return;
|
2021-02-20 07:29:13 +00:00
|
|
|
os.apiWithDialog('i/update-email', {
|
2020-11-25 12:31:34 +00:00
|
|
|
password: password,
|
|
|
|
email: this.emailAddress,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|