Skip to content

Commit 4961550

Browse files
committed
fix: saving of the hostname overrides modal
1 parent 0cbe911 commit 4961550

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

.changeset/crazy-seals-go.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webtools-addon-sitemap": patch
3+
---
4+
5+
fix: saving of the hostname overrides modal

packages/addons/sitemap/admin/components/HostnameModal/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const ModalForm = (props) => {
2626

2727
useEffect(() => {
2828
if (isOpen) {
29-
setHostnames({ ...hostnameOverrides });
29+
setHostnames({ ...hostnameOverrides.toJS() });
3030
} else {
3131
setHostnames({});
3232
}

packages/addons/sitemap/admin/state/reducers/Sitemap/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default function sitemapReducer(state = initialState, action) {
6969
.updateIn(['modifiedCustomEntries', action.url, action.key], () => action.value);
7070
case ON_CHANGE_SETTINGS:
7171
return state
72-
.updateIn(['settings', 'sitemaps', action.id, action.key], () => action.value);
72+
.updateIn(['settings', 'sitemaps', action.id, action.key], () => fromJS(action.value));
7373
case DISCARD_ALL_CHANGES:
7474
return state
7575
.updateIn(['settings', 'sitemaps', action.id], () => state.get('initialData'))

packages/addons/sitemap/admin/tabs/Settings/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const Settings = ({ id }) => {
2424
const [open, setOpen] = useState(false);
2525
const languages = useSelector((store) => store.getIn(['sitemap', 'languages'], {}));
2626
const settings = useSelector((state) => state.getIn(['sitemap', 'settings', 'sitemaps', id], Map()));
27-
const hostnameOverrides = useSelector((state) => state.getIn(['sitemap', 'settings', 'sitemaps', id, 'hostname_overrides'], {}));
27+
const hostnameOverrides = useSelector((state) => state.getIn(['sitemap', 'settings', 'sitemaps', id, 'hostname_overrides'], Map()));
2828
const [inputVisible, setInputVisible] = useState(settings.get('defaultLanguageUrlType') === DEFAULT_LANGUAGE_URL_TYPE_OTHER);
2929

3030
const saveHostnameOverrides = (hostnames) => {

0 commit comments

Comments
 (0)