Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Commit

Permalink
Merge pull request #267 from Wikia/fixes
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
hakubo authored Nov 21, 2017
2 parents be371eb + a3b50b0 commit 4fa9b9a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/components/recirculation-prefooter.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import fetch from 'fetch';
import {inject as service} from '@ember/service';
import Component from '@ember/component';
import {computed} from '@ember/object';
Expand Down
1 change: 1 addition & 0 deletions app/mixins/image-loader.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Mixin from '@ember/object/mixin';
import {Promise} from 'rsvp';

export default Mixin.create({
/**
Expand Down
5 changes: 3 additions & 2 deletions app/models/wikia-in-your-lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ function getCacheKey(lang) {
*/
function getFromCache(browserLang) {
const key = getCacheKey(browserLang),
value = JSON.parse(localStorageConnector.getItem(key)),
valueJson = localStorageConnector.getItem(key) || '{}',
value = JSON.parse(valueJson),
now = new Date().getTime();

// we cache for 30 days (2592000000)
if (!value || now - value.timestamp > 2592000000) {
if (!value.model || now - value.timestamp > 2592000000) {
return null;
}

Expand Down

0 comments on commit 4fa9b9a

Please sign in to comment.