1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-31 09:07:48 +01:00

Fix invalidateCache functionality

This commit is contained in:
Tim Daubenschütz 2015-11-04 11:36:42 +01:00
parent ecdcbbc25e
commit c17685731a
2 changed files with 26 additions and 1 deletions

View File

@ -18,7 +18,7 @@ const UserSource = {
success: UserActions.successFetchCurrentUser,
error: UserActions.currentUserFailed,
shouldFetch(state) {
return state.invalidateCache || state.currentUser && !state.currentUser.email;
return state.userMeta.invalidateCache || state.currentUser && !state.currentUser.email;
}
},

View File

@ -0,0 +1,25 @@
'use strict';
import requests from '../utils/requests';
import WhitelabelActions from '../actions/whitelabel_actions';
import { getSubdomain } from '../utils/general_utils';
const WhitelabelSource = {
lookupWhitelabel: {
remote() {
return requests.get('whitelabel_settings', {'subdomain': getSubdomain()});
},
local(state) {
return Object.keys(state.whitelabel).length > 0 ? state : {};
},
success: WhitelabelActions.successFetchWhitelabel,
error: WhitelabelActions.whitelabelFailed,
shouldFetch(state) {
return state.whitelabelMeta.invalidateCache || Object.keys(state.whitelabel).length === 0;
}
}
};
export default WhitelabelSource;