2020-11-25 06:31:34 -06:00
|
|
|
<template>
|
|
|
|
<FormBase>
|
|
|
|
<FormGroup>
|
2021-09-29 10:50:45 -05:00
|
|
|
<FormInput v-model="emailAddress" type="email">
|
2020-12-25 19:47:36 -06: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 06:31:34 -06:00
|
|
|
</FormInput>
|
|
|
|
</FormGroup>
|
2020-12-25 19:47:36 -06:00
|
|
|
<FormButton @click="save" primary>{{ $ts.save }}</FormButton>
|
2020-11-25 06:31:34 -06:00
|
|
|
</FormBase>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from 'vue';
|
2021-09-29 10:50:45 -05:00
|
|
|
import FormButton from '@client/components/debobigego/button.vue';
|
2021-03-23 03:30:14 -05:00
|
|
|
import FormInput from '@client/components/form/input.vue';
|
2021-09-29 10:50:45 -05:00
|
|
|
import FormBase from '@client/components/debobigego/base.vue';
|
|
|
|
import FormGroup from '@client/components/debobigego/group.vue';
|
2021-03-23 03:30:14 -05:00
|
|
|
import * as os from '@client/os';
|
2021-04-09 22:54:12 -05:00
|
|
|
import * as symbols from '@client/symbols';
|
2020-11-25 06:31:34 -06:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
|
|
|
FormBase,
|
|
|
|
FormInput,
|
|
|
|
FormButton,
|
|
|
|
FormGroup,
|
|
|
|
},
|
|
|
|
|
|
|
|
emits: ['info'],
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
2021-04-09 22:54:12 -05:00
|
|
|
[symbols.PAGE_INFO]: {
|
2020-12-25 19:47:36 -06:00
|
|
|
title: this.$ts.emailAddress,
|
2021-09-29 10:50:45 -05:00
|
|
|
icon: 'fas fa-envelope',
|
|
|
|
bg: 'var(--bg)',
|
2020-11-25 06:31:34 -06:00
|
|
|
},
|
|
|
|
emailAddress: null,
|
|
|
|
code: null,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
created() {
|
2020-12-18 19:55:52 -06:00
|
|
|
this.emailAddress = this.$i.email;
|
2020-11-25 06:31:34 -06:00
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
2021-04-09 22:54:12 -05:00
|
|
|
this.$emit('info', this[symbols.PAGE_INFO]);
|
2020-11-25 06:31:34 -06:00
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
save() {
|
|
|
|
os.dialog({
|
2020-12-25 19:47:36 -06:00
|
|
|
title: this.$ts.password,
|
2020-11-25 06:31:34 -06:00
|
|
|
input: {
|
|
|
|
type: 'password'
|
|
|
|
}
|
|
|
|
}).then(({ canceled, result: password }) => {
|
|
|
|
if (canceled) return;
|
2021-02-20 01:29:13 -06:00
|
|
|
os.apiWithDialog('i/update-email', {
|
2020-11-25 06:31:34 -06:00
|
|
|
password: password,
|
|
|
|
email: this.emailAddress,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|