Merge branch 'release' into develop

This commit is contained in:
Sabe Jones
2018-10-23 22:50:49 +00:00
116 changed files with 1446 additions and 1288 deletions
+17 -11
View File
@@ -3,7 +3,7 @@ import { authWithHeaders } from '../../middlewares/auth';
let api = {};
// @TODO export this const, cannot export it from here because only routes are exported from controllers
const LAST_ANNOUNCEMENT_TITLE = 'HABITICA BLOG: WIKI, USE CASE, AND GUILD SPOTLIGHTS';
const LAST_ANNOUNCEMENT_TITLE = 'VETERAN PETS AND NEW STAFF MEMBERS';
const worldDmg = { // @TODO
bailey: false,
};
@@ -30,19 +30,25 @@ api.getNews = {
<div class="mr-3 ${baileyClass}"></div>
<div class="media-body">
<h1 class="align-self-center">${res.t('newStuff')}</h1>
<h2>10/18/2018 - ${LAST_ANNOUNCEMENT_TITLE}</h2>
<h2>10/23/2018 - ${LAST_ANNOUNCEMENT_TITLE}</h2>
</div>
</div>
<hr/>
<div class="promo_fall_festival_2018 center-block"></div>
<h3>Blog Post: Grand Galas</h3>
<p>This month's <a href='https://habitica.wordpress.com/2018/10/17/grand-gala/' target='_blank'>featured Wiki article</a> is about Habitica's Grand Galas! We hope that it will help you as you enjoy Fall Festival and look forward to our other exciting galas. Be sure to check it out, and let us know what you think by reaching out on <a href='https://twitter.com/habitica' target='_blank'>Twitter</a>, <a href='http://blog.habitrpg.com' target='_blank'>Tumblr</a>, and <a href='https://facebook.com/habitica' target='_blank'>Facebook</a>.</p>
<div class="small mb-3">by shanaqui and the Wiki Wizards</div>
<div class="scene_positivity center-block"></div>
<h3>Use Case Spotlight and Guild Spotlight on Celebrating Yourself</h3>
<p>We've got new posts on the blog all about ways to use Habitica to help with celebrating yourself and your accomplishments ! First, there's a <a href='https://habitica.wordpress.com/2018/10/18/celebrating-your-achievements-guild-spotlight/' target='_blank'>Guild Spotlight</a> that highlights the Guilds that can help you as you explore ways to share your triumphs. We've also posted a <a href='https://habitica.wordpress.com/2018/10/18/use-case-spotlight-celebrate-yourself/' target='_blank'>Use Case Spotlight</a> featuring a number of great suggestions for using Habitica's task system and other areas to share your pride in your victories! These suggestions were submitted by Habiticans in the <a href='/groups/guild/1d3a10bf-60aa-4806-a38b-82d1084a59e6' target='_blank'>Use Case Spotlights Guild</a>.</p>
<p>Plus, we're collecting user submissions for the next Use Case Spotlight! How do you use Habitica to manage healthy habits for sleep and rest? Well be featuring player-submitted examples in Use Case Spotlights on the Habitica Blog next month, so post your suggestions in the Use Case Spotlight Guild now. We look forward to learning more about how you use Habitica to improve your life and get things done!</p>
<div class="small mb-3">by shanaqui</div>
<div class="promo_veteran_pets center-block"></div>
<h3>New Veteran Pet!</h3>
<p>Hello Habiticans! Everyone is doing really well with the transition to our new <a href='https://habitica.wordpress.com/2018/10/11/coming-soon-unique-usernames/' target='_blank'>unique username system</a>!</p>
<p>As a reward for confirming your username, you've been granted a veteran pet! If you haven't confimed yet, your new pet will appear in your Stable as soon as you do. Which pet? That depends on how many major changes to Habitica you've been around for.</p>
<p>Enjoy, and thank you for being part of our community- it means a lot to us! <3</p>
<div class="small mb-3">by Beffymaroo, SabreCat, Apollo, Piyo, viirus, Paglias, and TheHollidayInn</div>
<div class="media align-items-center">
<div class="npc_apollo ml-3"></div>
<div class="media-body">
<h3>New Staff Members: Apollo and Piyo</h3>
<p>We're thrilled to announce that our long-time designers Apollo and Piyo will be coming onboard as staff members! They've done a lot of beautiful work on the site and the mobile apps and we couldn't be happier to welcome them aboard. Go congratulate them in <a href='/groups/tavern'>the Tavern</a>!</p>
<div class="small mb-3">by the Habitica Team</div>
</div>
<div class="npc_piyo mr-3"></div>
</div>
</div>
`,
});
@@ -1,6 +1,5 @@
import { authWithHeaders } from '../../middlewares/auth';
import {
NotAuthorized,
NotFound,
} from '../../libs/errors';
import { model as PushDevice } from '../../models/pushDevice';
@@ -39,8 +38,10 @@ api.addPushDevice = {
type: req.body.type,
};
// When adding a duplicate push device, fail silently instead of throwing an error
if (pushDevices.find(device => device.regId === item.regId)) {
throw new NotAuthorized(res.t('pushDeviceAlreadyAdded'));
res.respond(200, user.pushDevices, res.t('pushDeviceAdded'));
return;
}
// Concurrency safe update