Skip to content

Commit

Permalink
fix wiki bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael18811380328 committed Dec 13, 2024
1 parent de925b1 commit eec7466
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions frontend/src/pages/wiki2/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ const getPaths = (navigation, currentPageId, pages, isGetPathStr) => {
const getNamePaths = (config, pageId) => {
const { navigation, pages } = config;
const { paths, curNode } = getPaths(navigation, pageId, pages, true);
if (!paths || !curNode) {
return { path: null, isDir: false };
}
const pathArr = paths.split('-');
const nameArr = [];
if (pathArr.length > 1) {
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,13 @@ export const Utils = {
errorMsg = gettext('Error');
}
} else {
errorMsg = gettext('Please check the network.');
if (typeof error === 'object' && error.name) {
errorMsg = error.name;
} else {
errorMsg = gettext('Please check the network.');
}
// eslint-disable-next-line
console.log(error);
}
return errorMsg;
},
Expand Down

0 comments on commit eec7466

Please sign in to comment.