Skip to content

Commit

Permalink
fix:兼容没有layout的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
fenglai0802 committed Jan 18, 2019
1 parent 09a19e4 commit 5d808ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
6 changes: 5 additions & 1 deletion tools/iceworks/app/main/scaffolder/lib/createPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ module.exports = async function createPage({
excludeLayout = false,
}) {
let fileList = [];
const layoutName = layout.name;
let layoutName = '';
if (layout) { // 兼容没有layout的情况,比如通过打开项目引入的项目很可能没有。
layoutName = layout.name;
}

routePath = routePath || pageName;

// 获取当前项目的package.json中的数据
Expand Down
4 changes: 0 additions & 4 deletions tools/iceworks/renderer/src/pages/Home/CreatPage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ class CreatePage extends Component {
this.statusCompileDisposer();
}

fetchData = () => {
this.props.newpage.fetch();
};

handleCancelCreate = () => {
this.props.newpage.toggle();
this.props.blocks.reset();
Expand Down
5 changes: 1 addition & 4 deletions tools/iceworks/renderer/src/stores/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,7 @@ class Projects extends EventEmitter {
@action
has(path) {
return this.list.some((project) => {
if (project.fullPath === path) {
return true;
}
return false;
return project.fullPath === path;
});
}

Expand Down

0 comments on commit 5d808ef

Please sign in to comment.