Commit 0fa906d9 authored by Joram Wilander's avatar Joram Wilander Committed by Harrison Healey
Browse files

Pull user from redux for browser store (#73)

parent 1c0eb5f9
......@@ -5,9 +5,16 @@ import {browserHistory} from 'react-router/es6';
import * as Utils from 'utils/utils.jsx';
import {Constants, ErrorPageTypes} from 'utils/constants.jsx';
import store from 'stores/redux_store.jsx';
function getPrefix() {
if (global.mm_user) {
return global.mm_user.id + '_';
const state = store.getState();
if (state && state.entities && state.entities.users) {
const user = state.entities.users.profiles[state.entities.users.currentUserId];
if (user) {
return user.id + '_';
}
}
console.warn('BrowserStore tried to operate without user present'); //eslint-disable-line no-console
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment