Fix frontend errors

This commit is contained in:
Yang Luo 2023-09-10 16:34:30 +08:00
parent 5fda8b936b
commit e71bb6d459
2 changed files with 15 additions and 8 deletions

View File

@ -117,7 +117,7 @@ class FileTree extends React.Component {
{" " + i18next.t("store:Please choose the type of your data")}
</div>
}
visible={this.state.isUploadFileModalVisible}
open={this.state.isUploadFileModalVisible}
onCancel={() => {
this.setState({
isUploadFileModalVisible: false,
@ -842,7 +842,11 @@ class FileTree extends React.Component {
getEditorHeightCss() {
// 79, 123
const filePaneHeight = this.filePane.current?.offsetHeight;
let filePaneHeight = this.filePane.current?.offsetHeight;
if (!filePaneHeight) {
filePaneHeight = 0;
}
return `calc(100vh - ${filePaneHeight + 186}px)`;
}

View File

@ -48,12 +48,15 @@ if (Conf.IsDemoMode) {
window.fetch = async(url, option = {}) => {
requestFilters.forEach(filter => filter(url, option));
return new Promise((resolve, reject) => {
originalFetch(url, option).then(res => {
// eslint-disable-next-line no-console
console.log(res.clone());
originalFetch(url, option)
.then(res => {
responseFilters.forEach(filter => filter(res.clone()));
resolve(res);
})
.catch(error => {
reject(error);
});
});
};