(limit = 2)
| 158 | }, |
| 159 | |
| 160 | checkForNewAchievement (limit = 2) { |
| 161 | if (limit <= 0) return; // Base case to stop recursion after 'limit' calls |
| 162 | |
| 163 | let startFrom; |
| 164 | const utils = require('core/utils') |
| 165 | if (utils.isOzaria) { return } // Not needed until/unlesss we start using achievements in Ozaria |
| 166 | if (me.get('lastAchievementChecked')) { |
| 167 | startFrom = new Date(me.get('lastAchievementChecked')) |
| 168 | } else { |
| 169 | startFrom = me.created() |
| 170 | } |
| 171 | |
| 172 | const daysSince = moment.duration(new Date() - startFrom).asDays() |
| 173 | if (daysSince > 1) { |
| 174 | return me.checkForNewAchievement().then(() => this.checkForNewAchievement(limit - 1)) |
| 175 | } |
| 176 | }, |
| 177 | |
| 178 | featureMode: { |
| 179 | useChina () { return api.admin.setFeatureMode('china').then(() => document.location.reload()) }, |
nothing calls this directly
no test coverage detected