Skip to content

Commit

Permalink
fix template picker race condition
Browse files Browse the repository at this point in the history
before templates fully load, it would try to render the picker, and not check for a null list of templates
  • Loading branch information
cameronsutter committed May 2, 2020
1 parent 5a85f30 commit 1f527ce
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "plottr",
"version": "2020.5.2",
"version": "2020.5.3",
"description": "An elegant writing tool that helps organize plotlines",
"repository": "https://github.com/cameronsutter/plottr_electron.git",
"homepage": "www.getplottr.com",
"homepage": "getplottr.com",
"private": true,
"readme": "Copyright 2016-2020 C. Louis S. (Cameron Sutter)",
"author": {
Expand Down
2 changes: 2 additions & 0 deletions src/app/components/characters/characterListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ class CharacterListView extends Component {
}

renderTemplatePicker () {
if (!this.state.showTemplatePicker) return null

return <TemplatePicker
modal={true}
type='characters'
Expand Down
2 changes: 2 additions & 0 deletions src/app/components/timeline/AddLineRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ class AddLineRow extends Component {
}

renderTemplatePicker () {
if (!this.state.showTemplatePicker) return null

return <TemplatePicker
type='plotlines'
modal={true}
Expand Down
1 change: 1 addition & 0 deletions src/common/utils/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const TEMPLATES_ROOT = 'templates'

export default function listTemplates (type) {
const templatesById = templateStore.get(TEMPLATES_ROOT)
if (!templatesById) return []
if (!type) return Object.values(templatesById)

const ids = Object.keys(templatesById)
Expand Down

0 comments on commit 1f527ce

Please sign in to comment.