From 79e5f368ed8707f5714a61b797b74e16046dc03f Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Thu, 9 Apr 2020 16:12:28 +0200 Subject: [PATCH] Fix deprecated use of createBrowserHistory --- app/javascript/core/public.js | 1 - app/javascript/flavours/glitch/components/modal_root.js | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/javascript/core/public.js b/app/javascript/core/public.js index 39f198fe72..8c26f14045 100644 --- a/app/javascript/core/public.js +++ b/app/javascript/core/public.js @@ -1,6 +1,5 @@ // This file will be loaded on public pages, regardless of theme. -import createHistory from 'history/createBrowserHistory'; import ready from '../mastodon/ready'; const { delegate } = require('@rails/ujs'); diff --git a/app/javascript/flavours/glitch/components/modal_root.js b/app/javascript/flavours/glitch/components/modal_root.js index f9877d5ead..8d73a1e407 100644 --- a/app/javascript/flavours/glitch/components/modal_root.js +++ b/app/javascript/flavours/glitch/components/modal_root.js @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import 'wicg-inert'; -import createHistory from 'history/createBrowserHistory'; +import { createBrowserHistory } from 'history'; export default class ModalRoot extends React.PureComponent { static contextTypes = { @@ -51,7 +51,7 @@ export default class ModalRoot extends React.PureComponent { componentDidMount () { window.addEventListener('keyup', this.handleKeyUp, false); window.addEventListener('keydown', this.handleKeyDown, false); - this.history = this.context.router ? this.context.router.history : createHistory(); + this.history = this.context.router ? this.context.router.history : createBrowserHistory(); } componentWillReceiveProps (nextProps) {