Skip to content

Commit

Permalink
Have some default characters selected in comparison views.
Browse files Browse the repository at this point in the history
  • Loading branch information
rawbee committed Oct 18, 2017
1 parent 1f2b166 commit b1fc83f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/window/character-comparison-base-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = class CharacterComparisonBaseView extends MainBaseView {
constructor(properties) {
super(properties)
this.selectionsAllowedCount = 2 // the allowed number of selections
this.selectedCharacters = this.selectedCharacters = this.getSelectedCharacters()
this.selectedCharacters = this.getSelectedCharacters()
this.valuesViewType = "table"

this.characterView = new CharacterView(properties)
Expand All @@ -24,6 +24,9 @@ module.exports = class CharacterComparisonBaseView extends MainBaseView {
this.characterView.updateView()
for(let character of inCharacters) {
this.charactersMap[character.id] = character
if(this.selectedCharacters.length<2) {
this.onSelectCharacter(character.id)
}
}
})
.catch(console.error)
Expand Down Expand Up @@ -61,7 +64,6 @@ module.exports = class CharacterComparisonBaseView extends MainBaseView {

getSelectedCharacterValues() {
let characterValuePromises = []
let selectedCharacters = []
for(let aCharacter of this.selectedCharacters) {
characterValuePromises.push(this.getCharacterValues(aCharacter.id))
}
Expand Down
1 change: 1 addition & 0 deletions js/window/main-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ const viewProperties = {
// Cache the system values
knex.select().table('Values')
.then(values => {
// convert these to normal json objects (instead of knex objects)
values = JSON.parse(JSON.stringify(values))
let end = Date.now()
valuesLib = values
Expand Down

0 comments on commit b1fc83f

Please sign in to comment.