fix: remove HOME_PATH (#43034)

It was only used as a default for hardGoTo, but that function is only
called once and does not need the default
This commit is contained in:
Oliver Eyton-Williams
2021-07-27 17:35:14 +02:00
committed by GitHub
parent 946f6847a7
commit 49b4e1f2b3
2 changed files with 2 additions and 8 deletions

View File

@ -167,13 +167,8 @@ exports.createPages = function createPages({ graphql, actions, reporter }) {
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
exports.onCreateWebpackConfig = ({ stage, plugins, actions }) => { exports.onCreateWebpackConfig = ({ stage, actions }) => {
const newPlugins = [ const newPlugins = [
plugins.define({
HOME_PATH: JSON.stringify(
process.env.HOME_PATH || 'http://localhost:3000'
)
}),
// We add the shims of the node globals to the global scope // We add the shims of the node globals to the global scope
new webpack.ProvidePlugin({ new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'] Buffer: ['buffer', 'Buffer']

View File

@ -1,4 +1,3 @@
/* global HOME_PATH */
import { ofType } from 'redux-observable'; import { ofType } from 'redux-observable';
import { tap, ignoreElements } from 'rxjs/operators'; import { tap, ignoreElements } from 'rxjs/operators';
@ -7,7 +6,7 @@ import { types } from './';
export default function hardGoToEpic(action$, _, { location }) { export default function hardGoToEpic(action$, _, { location }) {
return action$.pipe( return action$.pipe(
ofType(types.hardGoTo), ofType(types.hardGoTo),
tap(({ payload = HOME_PATH }) => { tap(({ payload }) => {
location.href = payload; location.href = payload;
}), }),
ignoreElements() ignoreElements()