We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f84b9cb commit afc0df7Copy full SHA for afc0df7
src/components/forms/siteurl.js
@@ -1,5 +1,18 @@
1
import { h, Component } from "preact";
2
3
+/**
4
+ * @arg {string} string
5
+ * @arg {string} ending
6
+ **/
7
+function removeFrom(string, mark) {
8
+ const index = string.indexOf(mark);
9
+ if (index === -1) {
10
+ return string;
11
+ }
12
+
13
+ return string.substring(0, string.length - mark.length);
14
+}
15
16
export default class SiteURLForm extends Component {
17
constructor(props) {
18
super(props);
@@ -12,7 +25,8 @@ export default class SiteURLForm extends Component {
25
26
addSiteURL = (e) => {
27
e.preventDefault();
- this.props.onSiteURL(this.state.url);
28
+ const url = removeFrom(this.state.url, "/.netlify/identity");
29
+ this.props.onSiteURL(url);
30
};
31
32
clearSiteURL = (e) => {
0 commit comments