mirror of
https://github.com/romancm/gamebrary
synced 2025-02-17 19:48:24 +00:00
rename non legacy actions
This commit is contained in:
parent
1f655b9783
commit
1a9b7ffb6b
2 changed files with 46 additions and 45 deletions
|
@ -453,7 +453,7 @@ export default {
|
|||
|
||||
this.$store.commit('SET_GAME_PROGRESS', payload);
|
||||
|
||||
await this.$store.dispatch('SAVE_PROGRESSES_LEGACY')
|
||||
await this.$store.dispatch('SAVE_PROGRESSES')
|
||||
.catch(() => {
|
||||
this.$bvToast.toast('There was an error saving your progress', { title: 'Error', variant: 'error' });
|
||||
this.$router.push({ name: 'sessionExpired' });
|
||||
|
@ -483,7 +483,7 @@ export default {
|
|||
|
||||
this.$store.commit('SET_GAME_NOTE', payload);
|
||||
|
||||
await this.$store.dispatch('SAVE_NOTES_LEGACY')
|
||||
await this.$store.dispatch('SAVE_NOTES')
|
||||
.catch(() => {
|
||||
this.$bvToast.toast('There was an error saving your note', { title: 'Error', variant: 'danger' });
|
||||
this.$router.push({ name: 'sessionExpired' });
|
||||
|
@ -497,7 +497,7 @@ export default {
|
|||
async deleteNote() {
|
||||
this.$store.commit('REMOVE_GAME_NOTE', this.gameId);
|
||||
|
||||
await this.$store.dispatch('SAVE_NOTES_NO_MERGE_LEGACY')
|
||||
await this.$store.dispatch('SAVE_NOTES_NO_MERGE')
|
||||
.catch(() => {
|
||||
this.$bvToast.toast('There was an error deleting your note', { title: 'Error', variant: 'danger' });
|
||||
this.$router.push({ name: 'sessionExpired' });
|
||||
|
@ -509,7 +509,6 @@ export default {
|
|||
},
|
||||
|
||||
addGame() {
|
||||
// TODO: destructure
|
||||
const data = {
|
||||
listId: this.listId,
|
||||
gameId: this.game.id,
|
||||
|
@ -606,7 +605,7 @@ export default {
|
|||
|
||||
this.$store.commit('REMOVE_GAME_PROGRESS', gameId);
|
||||
|
||||
await this.$store.dispatch('SAVE_PROGRESSES_NO_MERGE_LEGACY')
|
||||
await this.$store.dispatch('SAVE_PROGRESSES_NO_MERGE')
|
||||
.catch(() => {
|
||||
this.$bvToast.toast('There was an error deleting your progress', { title: 'Error', variant: 'error' });
|
||||
this.$router.push({ name: 'sessionExpired' });
|
||||
|
|
|
@ -183,26 +183,6 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
SAVE_PROGRESSES_LEGACY({ state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const db = firebase.firestore();
|
||||
|
||||
db.collection('progresses').doc(state.user.uid).set(state.progresses, { merge: true })
|
||||
.then(() => resolve())
|
||||
.catch(reject);
|
||||
});
|
||||
},
|
||||
|
||||
SAVE_PROGRESSES_NO_MERGE_LEGACY({ state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const db = firebase.firestore();
|
||||
|
||||
db.collection('progresses').doc(state.user.uid).set(state.progresses, { merge: false })
|
||||
.then(() => resolve())
|
||||
.catch(reject);
|
||||
});
|
||||
},
|
||||
|
||||
SAVE_TAGS_LEGACY({ state }, tags) {
|
||||
const db = firebase.firestore();
|
||||
|
||||
|
@ -223,26 +203,6 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
SAVE_NOTES_LEGACY({ state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const db = firebase.firestore();
|
||||
|
||||
db.collection('notes').doc(state.user.uid).set(state.notes, { merge: true })
|
||||
.then(() => resolve())
|
||||
.catch(reject);
|
||||
});
|
||||
},
|
||||
|
||||
SAVE_NOTES_NO_MERGE_LEGACY({ state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const db = firebase.firestore();
|
||||
|
||||
db.collection('notes').doc(state.user.uid).set(state.notes, { merge: false })
|
||||
.then(() => resolve())
|
||||
.catch(reject);
|
||||
});
|
||||
},
|
||||
|
||||
SAVE_LIST_NO_MERGE_LEGACY({ commit, state }, payload) {
|
||||
const db = firebase.firestore();
|
||||
|
||||
|
@ -280,6 +240,48 @@ export default {
|
|||
// STUFF THAT REMAINS THE SAME
|
||||
//
|
||||
|
||||
// TODO: combine into single action
|
||||
SAVE_NOTES({ state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const db = firebase.firestore();
|
||||
|
||||
db.collection('notes').doc(state.user.uid).set(state.notes, { merge: true })
|
||||
.then(() => resolve())
|
||||
.catch(reject);
|
||||
});
|
||||
},
|
||||
|
||||
SAVE_NOTES_NO_MERGE({ state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const db = firebase.firestore();
|
||||
|
||||
db.collection('notes').doc(state.user.uid).set(state.notes, { merge: false })
|
||||
.then(() => resolve())
|
||||
.catch(reject);
|
||||
});
|
||||
},
|
||||
|
||||
// TODO: combine into single action
|
||||
SAVE_PROGRESSES_NO_MERGE({ state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const db = firebase.firestore();
|
||||
|
||||
db.collection('progresses').doc(state.user.uid).set(state.progresses, { merge: false })
|
||||
.then(() => resolve())
|
||||
.catch(reject);
|
||||
});
|
||||
},
|
||||
|
||||
SAVE_PROGRESSES({ state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const db = firebase.firestore();
|
||||
|
||||
db.collection('progresses').doc(state.user.uid).set(state.progresses, { merge: true })
|
||||
.then(() => resolve())
|
||||
.catch(reject);
|
||||
});
|
||||
},
|
||||
|
||||
// TODO: use firebase email extension instead
|
||||
SEND_WELCOME_EMAIL(context, additionalUserInfo) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue