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>
This commit is contained in:
Liyas Thomas
2020-10-17 14:53:19 +05:30
committed by GitHub
parent b6b3cbcb9a
commit 22a3bba6ab
13 changed files with 2408 additions and 473 deletions

View File

@@ -8,7 +8,6 @@
</template>
<script>
import firebase from "firebase/app"
import { fb } from "~/helpers/fb"
import exitToAppIcon from "~/static/icons/exit_to_app-24px.svg?inline"
@@ -20,20 +19,18 @@ export default {
}
},
methods: {
logout() {
fb.currentUser = null
const self = this
firebase
.auth()
.signOut()
.catch((err) => {
self.$toast.show(err.message || err, {
icon: "error",
})
async logout() {
try {
await fb.signOutUser()
this.$toast.info(this.$t("logged_out"), {
icon: "vpn_key",
})
self.$toast.info(this.$t("logged_out"), {
icon: "vpn_key",
})
} catch (err) {
this.$toast.show(err.message || err, {
icon: "error",
})
}
},
},
}