Skip to content

Commit c992ce4

Browse files
committed
fix: extrapolate dev mode check into function that saves to store
1 parent 528cdab commit c992ce4

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/components/app.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class App extends Component {
9191
const page = pages[store.modal.page] || {};
9292
const pageLinkHandler = () => this.handlePage(page.link);
9393

94-
if (process.env.NODE_ENV === "development" && store.siteURL === null) {
94+
if (store.isLocal && store.siteURL === null) {
9595
return (
9696
<SiteURLForm
9797
devMode={store.siteURL != null}
@@ -132,7 +132,7 @@ class App extends Component {
132132
{page.link_text}
133133
</button>
134134
)}
135-
{process.env.NODE_ENV === "development" ? (
135+
{store.isLocal ? (
136136
<SiteURLForm
137137
devMode={store.siteURL != null}
138138
onSiteURL={store.siteURL ? this.clearSiteURL : this.handleSiteURL}

src/netlify-identity.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ function setStyle(el, css) {
6969
const localHosts = {
7070
localhost: true,
7171
"127.0.0.1": true,
72-
"0.0.0.0": true
72+
"0.0.0.0": true,
73+
"identity.netlify.com": true
7374
};
7475

7576
function instantiateGotrue(APIUrl) {
@@ -84,6 +85,7 @@ function instantiateGotrue(APIUrl) {
8485
parts.push("/");
8586
}
8687
parts.push(".netlify/identity");
88+
store.setIsLocal(isLocal);
8789
store.setSiteURL(siteURL);
8890
return new GoTrue({ APIUrl: parts.join(""), setCookie: !isLocal });
8991
}

src/state/store.js

+4
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ store.loadSettings = action(function loadSettings() {
6868
);
6969
});
7070

71+
store.setIsLocal = action(function setIsLocal(isLocal) {
72+
store.isLocal = isLocal;
73+
});
74+
7175
store.setSiteURL = action(function setSiteURL(url) {
7276
store.siteURL = url;
7377
});

0 commit comments

Comments
 (0)