FIX Guild suggestion incorrectly identifies account as new #11159 (#11197)

* Changed the suggested guild string to a translatable string and made changes so that the string only shows within 60 days of user profile creation.

* Removed whitespace.
This commit is contained in:
garayj 2019-05-31 03:26:15 -07:00 committed by Matteo Pagliazzi
parent 75281ab638
commit 4b2fd60e47
2 changed files with 6 additions and 4 deletions

View file

@ -25,7 +25,7 @@ router-link.card-link(:to="{ name: 'guild', params: { groupId: guild._id } }")
div.guild-bank(v-if='displayGemBank', v-once) {{$t('guildBank')}}
.row
category-tags.col-md-12(:categories="guild.categories", :owner="isOwner", v-once)
span.recommend-text(v-if='showSuggested(guild._id)') Suggested because youre new to Habitica.
span.recommend-text(v-if='showSuggested(guild._id)') {{$t('suggestedGroup')}}
</template>
<style lang="scss" scoped>
@ -175,8 +175,9 @@ export default {
methods: {
showSuggested (guildId) {
let habiticaHelpingGuildId = '5481ccf3-5d2d-48a9-a871-70a7380cee5a';
let createdAfterRedesign = moment(this.user.auth.timestamps.created).isAfter('2017-08-01');
return guildId === habiticaHelpingGuildId && createdAfterRedesign;
let sixtyDaysAgoFromNow = moment().subtract(60, 'days');
let isUserNew = moment(this.user.auth.timestamps.created).isAfter(sixtyDaysAgoFromNow);
return guildId === habiticaHelpingGuildId && isUserNew;
},
async join () {
// @TODO: This needs to be in the notifications where users will now accept invites

View file

@ -485,5 +485,6 @@
"sharedCompletion": "Completion Conditon",
"recurringCompletion": "None - Group task does not complete",
"singleCompletion": "Single - Completes when any assigned user finishes",
"allAssignedCompletion": "All - Completes when all assigned users finish"
"allAssignedCompletion": "All - Completes when all assigned users finish",
"suggestedGroup": "Suggested because youre new to Habitica."
}