Skip to content

Commit

Permalink
[renderer] event_available.reward_id => event_data.bg_id
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed May 22, 2018
1 parent 4b9cfc2 commit 57bb9a3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build_from_source = true
runtime = "electron"
target = "2.0.0"
target = "2.0.1"
dist_url = "https://atom.io/download/electron"
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@types/uglifyjs-webpack-plugin": "^1.1.0",
"@types/webpack": "^4.1.3",
"css-loader": "^0.28.11",
"electron": "2.0.0",
"electron": "2.0.1",
"electron-packager": "^12.0.2",
"fs-extra": "^6.0.0",
"mini-css-extract-plugin": "^0.4.0",
Expand Down
17 changes: 10 additions & 7 deletions src/ts/renderer/mishiro-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ export default class extends Vue {
@Prop() value!: any
@Prop() isTouched!: boolean

getEventCardId (eventAvailable: any[]): number[] {
eventAvailable.sort(function (a, b) {
return a.recommend_order - b.recommend_order
})
return [eventAvailable[0].reward_id, eventAvailable[eventAvailable.length - 1].reward_id]
getEventCardId (/* eventAvailable: any[] */eventData: any): number[] {
// eventAvailable.sort(function (a, b) {
// return a.recommend_order - b.recommend_order
// })
// console.log(eventAvailable)
// return [eventAvailable[0].reward_id, eventAvailable[eventAvailable.length - 1].reward_id]
return [Number(eventData.bg_id) - 1]
}

@Emit('ready')
Expand Down Expand Up @@ -183,8 +185,9 @@ export default class extends Vue {
}
}

const eventAvailable = masterData.eventAvailable
const cardId = this.getEventCardId(eventAvailable)
// const eventAvailable = masterData.eventAvailable
// const cardId = this.getEventCardId(eventAvailable)
const cardId = this.getEventCardId(masterData.eventData)

if (masterData.eventHappening) {
localStorage.setItem('msrEvent', `{"id":${masterData.eventData.id},"card":${Number(cardId[0]) + 1}}`)
Expand Down

0 comments on commit 57bb9a3

Please sign in to comment.