47 lines
878 B
Vue
47 lines
878 B
Vue
<template>
|
|
<div class="flex">
|
|
<SmartItem
|
|
icon="exit_to_app"
|
|
:label="$t('logout')"
|
|
@click.native="
|
|
$emit('confirm-logout')
|
|
confirmLogout = true
|
|
"
|
|
/>
|
|
<SmartConfirmModal
|
|
:show="confirmLogout"
|
|
:title="$t('are_you_sure_logout')"
|
|
@hide-modal="confirmLogout = false"
|
|
@resolve="logout"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import Vue from "vue"
|
|
import { signOutUser } from "~/helpers/fb/auth"
|
|
|
|
export default Vue.extend({
|
|
data() {
|
|
return {
|
|
confirmLogout: false,
|
|
}
|
|
},
|
|
methods: {
|
|
async logout() {
|
|
try {
|
|
await signOutUser()
|
|
|
|
this.$toast.info(this.$t("logged_out").toString(), {
|
|
icon: "vpn_key",
|
|
})
|
|
} catch (err) {
|
|
this.$toast.show(err.message || err, {
|
|
icon: "error",
|
|
})
|
|
}
|
|
},
|
|
},
|
|
})
|
|
</script>
|