mirror of
https://github.com/wassname/talk.git
synced 2026-07-10 07:49:12 +08:00
Pass sessionStorage to context
This commit is contained in:
@@ -12,8 +12,11 @@ class TalkProvider extends React.Component {
|
||||
graphql: this.props.graphql,
|
||||
notification: this.props.notification,
|
||||
localStorage: this.props.localStorage,
|
||||
sessionStorage: this.props.sessionStorage,
|
||||
history: this.props.history,
|
||||
store: this.props.store,
|
||||
pymLocalStorage: this.props.pymLocalStorage,
|
||||
pymSessionStorage: this.props.pymSessionStorage,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -31,8 +34,13 @@ TalkProvider.childContextTypes = {
|
||||
graphql: PropTypes.object,
|
||||
notification: PropTypes.object,
|
||||
localStorage: PropTypes.object,
|
||||
sessionStorage: PropTypes.object,
|
||||
pymLocalStorage: PropTypes.object,
|
||||
pymSessionStorage: PropTypes.object,
|
||||
history: PropTypes.object,
|
||||
store: PropTypes.object,
|
||||
};
|
||||
|
||||
TalkProvider.propTypes = TalkProvider.childContextTypes;
|
||||
|
||||
export default TalkProvider;
|
||||
|
||||
@@ -65,7 +65,9 @@ export async function createContext({
|
||||
} = {}) {
|
||||
const eventEmitter = new EventEmitter({ wildcard: true });
|
||||
const localStorage = createStorage('localStorage');
|
||||
const sessionStorage = createStorage('sessionStorage');
|
||||
const pymLocalStorage = createPymStorage(pym, 'localStorage');
|
||||
const pymSessionStorage = createPymStorage(pym, 'sessionStorage');
|
||||
const history = createHistory(BASE_PATH);
|
||||
const introspection = createIntrospection(introspectionData);
|
||||
let store = null;
|
||||
@@ -117,9 +119,11 @@ export async function createContext({
|
||||
graphql,
|
||||
notification,
|
||||
localStorage,
|
||||
sessionStorage,
|
||||
history,
|
||||
introspection,
|
||||
pymLocalStorage,
|
||||
pymSessionStorage,
|
||||
};
|
||||
|
||||
// Load framework fragments.
|
||||
|
||||
Reference in New Issue
Block a user