Challenges plus misc fixes (#8961)

* Forced full refresh after deletE

* Fixed styles on firefox

* Removed instagram link

* Added information to modal

* Fixed deleteing and task keeping

* Added redirect to challenge detail after created

* Updated challenge item styles

* Added new limit option to challenges
This commit is contained in:
Keith Holliday
2017-08-17 11:03:32 -06:00
committed by GitHub
parent f5cf27a79e
commit de63622cdd
13 changed files with 60 additions and 33 deletions

View File

@@ -257,11 +257,18 @@ export default {
await this.$store.dispatch('challenges:joinChallenge', {challengeId: this.challengeId});
},
async leaveChallenge () {
let keepChallenge = confirm('Do you want to keep challenge tasks?');
let keep = 'keep-all';
if (!keepChallenge) keep = 'remove-all';
let index = findIndex(this.user.challenges, (challengeId) => {
return challengeId === this.challengeId;
});
this.user.challenges.splice(index, 1);
await this.$store.dispatch('challenges:leaveChallenge', {challengeId: this.challengeId});
await this.$store.dispatch('challenges:leaveChallenge', {
challengeId: this.challengeId,
keep,
});
},
closeChallenge () {
this.$root.$emit('show::modal', 'close-challenge-modal');