Misc. bug fixes from lgtm.com (2) (#9474)

* Remove dead branch of ternary: `gift` is always truthy here

Problem found here:

- https://lgtm.com/projects/g/HabitRPG/habitrpg/snapshot/dist-98076885-1510577633582/files/website/server/libs/amazonPayments.js?sort=name&dir=ASC&mode=heatmap&excluded=false#x5a22f31110a55091:1

* Remove superfluous argument, preenUserHistory only takes two args

Problem found here:

- https://lgtm.com/projects/g/HabitRPG/habitrpg/snapshot/dist-98076885-1510577633582/files/website/server/libs/cron.js?sort=name&dir=ASC&mode=heatmap&excluded=false#xf16a045ecabb07f6:1

* Cleanup: remove useless assignments

Problems found here:

- https://lgtm.com/projects/g/HabitRPG/habitrpg/snapshot/dist-98076885-1510577633582/files/website/client/store/actions/shops.js?sort=name&dir=ASC&mode=heatmap&excluded=false#xf782ed2cf920441%3A1
- https://lgtm.com/projects/g/HabitRPG/habitrpg/snapshot/dist-98076885-1510577633582/files/website/client/app.vue?sort=name&dir=ASC&mode=heatmap&excluded=false#x172c1dda85e84dc8%3A1
- https://lgtm.com/projects/g/HabitRPG/habitrpg/snapshot/dist-98076885-1510577633582/files/website/client/components/settings/site.vue#x9b3afee802a3a8f8%3A1
- https://lgtm.com/projects/g/HabitRPG/habitrpg/snapshot/dist-98076885-1510577633582/files/website/client/components/selectMembersModal.vue?sort=name&dir=ASC&mode=heatmap&excluded=false#x1fbc2a3d62facd70:1
- https://lgtm.com/projects/g/HabitRPG/habitrpg/snapshot/dist-98076885-1510577633582/files/website/common/script/libs/taskClasses.js?sort=name&dir=ASC&mode=heatmap&excluded=false#x41ce0e121a4defee:1

* Fix online editor whitespace change.
This commit is contained in:
Esben Sparre Andreasen
2017-11-28 02:51:25 +01:00
committed by Sabe Jones
parent f62177fb1a
commit b62f08d500
7 changed files with 13 additions and 8 deletions
+1 -2
View File
@@ -296,7 +296,6 @@ export default {
const modalId = bvEvent.target.id;
let modalStackLength = this.$store.state.modalStack.length;
let modalOnTop = this.$store.state.modalStack[modalStackLength - 1];
let modalSecondToTop = this.$store.state.modalStack[modalStackLength - 2];
// Don't remove modal if hid was called from main app
// @TODO: I'd reather use this, but I don't know how to pass data to hidden event
@@ -308,7 +307,7 @@ export default {
// Recalculate and show the last modal if there is one
modalStackLength = this.$store.state.modalStack.length;
modalOnTop = this.$store.state.modalStack[modalStackLength - 1];
let modalOnTop = this.$store.state.modalStack[modalStackLength - 1];
if (modalOnTop) this.$root.$emit('bv::show::modal', modalOnTop, {fromRoot: true});
});
},
@@ -133,7 +133,7 @@ export default {
let sortedMembers = this.members;
if (!this.sortOption) return sortedMembers;
sortedMembers = sortBy(this.members, [(member) => {
sortBy(this.members, [(member) => {
if (this.sortOption === 'tier') {
if (!member.contributor) return;
return member.contributor.level;
@@ -341,7 +341,6 @@ export default {
await axios.put(`/api/v3/user/auth/update-${attribute}`, updates);
alert(this.$t(`${attribute}Success`));
this.user[attribute] = updates[attribute];
updates = {};
},
openRestoreModal () {
this.$root.$emit('bv::show::modal', 'restore');
+8
View File
@@ -41,6 +41,14 @@ async function buyArmoire (store, params) {
const quantity = params.quantity || 1;
let armoire = content.armoire;
buyOp(store.state.user.data, {
params: {
key: 'armoire',
},
type: 'armoire',
quantity,
});
// We need the server result because Armoire has random item in the result
let result = await axios.post('/api/v3/user/buy/armoire', {
type: 'armoire',