1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-28 13:39:11 +09:00
misskey/src/client/pages/settings/email-address.vue

73 lines
1.6 KiB
Vue
Raw Normal View History

<template>
<FormBase>
<FormGroup>
<FormInput v-model:value="emailAddress" type="email">
2020-12-26 10:47:36 +09: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>
</FormInput>
</FormGroup>
2020-12-26 10:47:36 +09:00
<FormButton @click="save" primary>{{ $ts.save }}</FormButton>
</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 17:30:14 +09: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';
2021-04-10 12:54:12 +09:00
import * as symbols from '@client/symbols';
export default defineComponent({
components: {
FormBase,
FormInput,
FormButton,
FormGroup,
},
emits: ['info'],
data() {
return {
2021-04-10 12:54:12 +09:00
[symbols.PAGE_INFO]: {
2020-12-26 10:47:36 +09:00
title: this.$ts.emailAddress,
icon: faEnvelope
},
emailAddress: null,
code: null,
faCog
}
},
created() {
this.emailAddress = this.$i.email;
},
mounted() {
2021-04-10 12:54:12 +09:00
this.$emit('info', this[symbols.PAGE_INFO]);
},
methods: {
save() {
os.dialog({
2020-12-26 10:47:36 +09:00
title: this.$ts.password,
input: {
type: 'password'
}
}).then(({ canceled, result: password }) => {
if (canceled) return;
2021-02-20 16:29:13 +09:00
os.apiWithDialog('i/update-email', {
password: password,
email: this.emailAddress,
});
});
}
}
});
</script>