Files
hoppscotch/components/firebase/logout.vue
Liyas Thomas 22a3bba6ab Cherry picking refactored fb.js from #879 by @AndrewBastin (#1286)
* Cherry picking refactored fb.js from #879 by @AndrewBastin

* Fixed a minor UI glitch in History section

* Removed logout success toast testcase

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
2020-10-17 14:53:19 +05:30

38 lines
711 B
Vue

<template>
<div>
<button class="icon" @click="logout" v-close-popover>
<exitToAppIcon class="material-icons" />
<span>{{ $t("logout") }}</span>
</button>
</div>
</template>
<script>
import { fb } from "~/helpers/fb"
import exitToAppIcon from "~/static/icons/exit_to_app-24px.svg?inline"
export default {
components: { exitToAppIcon },
data() {
return {
fb,
}
},
methods: {
async logout() {
try {
await fb.signOutUser()
this.$toast.info(this.$t("logged_out"), {
icon: "vpn_key",
})
} catch (err) {
this.$toast.show(err.message || err, {
icon: "error",
})
}
},
},
}
</script>