Skip to content

Commit

Permalink
fix empty state
Browse files Browse the repository at this point in the history
  • Loading branch information
zehfernandes committed Sep 26, 2017
1 parent 1af9958 commit e90d894
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/ListMockup.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ export default class ListMockup extends Component {
</h4>
: null}

{name !== 'Default Mockups' ?
{name !== 'Default Mockups' && items.length > 0 ?
<a onClick={this.handleEditMode} className="f5 link absolute right-0 pr3 dim pointer" style="color: #A7A7A7; top:15.5px;">
{this.state.edit ? 'cancel editing' : 'edit mode' }
</a>
{this.state.edit ? 'cancel editing' : 'edit mode'}
</a>
: null}

<ul className="pa0 ma0 list w-100 cf relative">
Expand Down
5 changes: 4 additions & 1 deletion lib/getTemplates.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ const userDataPath = (electron.app || electron.remote.app)
const thumbsPath = `${userDataPath}/templates/thumbs`
const mockupsPath = `${userDataPath}/templates/mockups`

if (!fs.existsSync(`${userDataPath}/templates`)) fs.mkdirSync(`${userDataPath}/templates`)
if (!fs.existsSync(`${mockupsPath}`)) fs.mkdirSync(mockupsPath)
if (!fs.existsSync(`${thumbsPath}`)) fs.mkdirSync(thumbsPath)

function getAllTemplatesFiles() {
if (!fs.existsSync(`${userDataPath}/templates`)) createTemplateDirectory()
return fs
.readdirSync(`${userDataPath}/templates`)
.filter(fileName => /\.(json)/.test(fileName))
Expand Down

0 comments on commit e90d894

Please sign in to comment.