mirror of
https://github.com/romancm/gamebrary
synced 2024-11-24 12:13:08 +00:00
use ternary operator instead of if else
This commit is contained in:
parent
f98d18b4ed
commit
9c5dd5bce6
1 changed files with 3 additions and 5 deletions
|
@ -242,11 +242,9 @@ export default {
|
|||
const docRef = db.collection('settings').doc(this.user.uid);
|
||||
|
||||
docRef.get().then((doc) => {
|
||||
if (doc.exists) {
|
||||
this.$store.commit('SET_SETTINGS', doc.data());
|
||||
} else {
|
||||
this.initSettings();
|
||||
}
|
||||
return doc.exists
|
||||
? this.$store.commit('SET_SETTINGS', doc.data())
|
||||
: this.initSettings();
|
||||
}).catch(() => {
|
||||
this.$bus.$emit('TOAST', { message: 'Authentication error', type: 'error' });
|
||||
this.$router.push({ name: 'sessionExpired' });
|
||||
|
|
Loading…
Reference in a new issue