Skip to content

Commit 20f8789

Browse files
Merge pull request #39 from devgateway/wp-react-lib-ts
2 parents 447aa03 + 7ea6235 commit 20f8789

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@devgateway/wp-react-lib": patch
3+
---
4+
5+
Fix rendering issues in the replace link but handling empty values

wp-react-lib/src/reducers/actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export const getMenu = ({slug, locale = "en"}) => (dispatch, getState) => {
201201
}
202202

203203

204-
export const getSettings = ({locale = "en",changeUUID=null}) => (dispatch, getState) => {
204+
export const getSettings = ({locale = "en", changeUUID=null}) => (dispatch, getState) => {
205205
dispatch({type: LOAD_SETTINGS})
206206
wp.getSettings(locale,changeUUID).then(response => {
207207
const {data, meta} = response

wp-react-lib/src/util/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const useHash = process.env.VITE_REACT_APP_USE_HASH_LINKS;
44
export const replaceLink = (url, locale) => {
55
//console.log("--------- replaceLink--------------")
66
//console.log(process.env.REACT_APP_WP_HOSTS)
7-
const replacementTarget = process.env.VITE_REACT_APP_WP_HOSTS.split(",")
7+
const replacementTarget = process.env.VITE_REACT_APP_WP_HOSTS?.split(",") || []
88
let all = new RegExp("^(http|https)://(" + replacementTarget.join('|') + ")", "ig");
99
if (useHash && url) {
1010
return url.replaceAll(all, "#" + locale)

0 commit comments

Comments
 (0)