2020-03-05 01:18:10 +00:00
|
|
|
<template>
|
2021-07-05 16:52:15 +00:00
|
|
|
<div class="flex">
|
|
|
|
|
<SmartItem
|
2021-07-03 13:14:58 +00:00
|
|
|
icon="exit_to_app"
|
|
|
|
|
:label="$t('logout')"
|
2021-07-05 16:52:15 +00:00
|
|
|
@click.native="
|
|
|
|
|
$emit('confirm-logout')
|
|
|
|
|
confirmLogout = true
|
|
|
|
|
"
|
|
|
|
|
/>
|
|
|
|
|
<SmartConfirmModal
|
|
|
|
|
:show="confirmLogout"
|
2021-08-02 15:27:18 +00:00
|
|
|
:title="$t('confirm.logout')"
|
2021-07-05 16:52:15 +00:00
|
|
|
@hide-modal="confirmLogout = false"
|
|
|
|
|
@resolve="logout"
|
2021-07-03 13:14:58 +00:00
|
|
|
/>
|
2020-03-05 01:18:10 +00:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2021-06-14 04:07:30 +00:00
|
|
|
<script lang="ts">
|
|
|
|
|
import Vue from "vue"
|
|
|
|
|
import { signOutUser } from "~/helpers/fb/auth"
|
2020-03-05 01:18:10 +00:00
|
|
|
|
2021-06-14 04:07:30 +00:00
|
|
|
export default Vue.extend({
|
2021-07-05 16:52:15 +00:00
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
confirmLogout: false,
|
|
|
|
|
}
|
|
|
|
|
},
|
2020-03-05 01:18:10 +00:00
|
|
|
methods: {
|
2020-10-17 09:23:19 +00:00
|
|
|
async logout() {
|
|
|
|
|
try {
|
2021-06-14 04:07:30 +00:00
|
|
|
await signOutUser()
|
2020-10-17 09:23:19 +00:00
|
|
|
|
2021-06-14 04:07:30 +00:00
|
|
|
this.$toast.info(this.$t("logged_out").toString(), {
|
2020-10-17 09:23:19 +00:00
|
|
|
icon: "vpn_key",
|
|
|
|
|
})
|
2021-08-11 11:27:40 +00:00
|
|
|
} catch (e) {
|
|
|
|
|
console.error(e)
|
|
|
|
|
this.$toast.error(this.$t("error.something_went_wrong").toString(), {
|
2020-10-17 09:23:19 +00:00
|
|
|
icon: "error",
|
2020-03-05 01:18:10 +00:00
|
|
|
})
|
2020-10-17 09:23:19 +00:00
|
|
|
}
|
2020-03-05 01:18:10 +00:00
|
|
|
},
|
|
|
|
|
},
|
2021-06-14 04:07:30 +00:00
|
|
|
})
|
2020-03-05 01:18:10 +00:00
|
|
|
</script>
|