Skip to content

Commit

Permalink
#52 Cleanup: space after negation
Browse files Browse the repository at this point in the history
  • Loading branch information
drweissbrot committed Jun 18, 2023
1 parent 24bccca commit 0367f0e
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/assets/vue3-sfc-loader-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const sfcLoaderOptions = {

getFile: async (url) => {
const res = await fetch(url)
if (!res.ok) throw Object.assign(new Error(res.statusText + ' ' + url), { res })
if (! res.ok) throw Object.assign(new Error(res.statusText + ' ' + url), { res })

// #65: this enables using query params
const pathname = new URL(`${window.location.origin}${url}`).pathname
Expand Down
2 changes: 1 addition & 1 deletion src/server/gsi.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { additionalState, gsiState } from './state.js'
export const registerGsiRoutes = (router, websocket) => {
router.post('/gsi', (context) => {
const userAgent = context.request.headers['user-agent']
if (!userAgent.startsWith('Valve/Steam HTTP Client')) return context.status = 400
if (! userAgent.startsWith('Valve/Steam HTTP Client')) return context.status = 400

const body = context.request.body
const authToken = body.auth.token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
},

isBombActive() {
return this.player?.weapons?.find((weapon) => weapon.isActive)?.isBomb
return !! this.player?.bomb?.isActive
},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
},

isActive() {
return this.player?.weapons?.find((weapon) => weapon.isActive)?.isTaser
return !! this.player?.taser?.isActive
},
},
}
2 changes: 1 addition & 1 deletion src/themes/fennec/players-alive/players-alive.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
computed: {
isActive() {
if (this.$opts['preferences.playersAlive.hideDuringFreezetime']) {
return !this.$round.isFreezetime
return ! this.$round.isFreezetime
}

return true
Expand Down
2 changes: 1 addition & 1 deletion src/themes/fennec/series-graph/series-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default {
const scoreB = this.$opts[`series.maps.${mapNumber}.enemyTeamScore`]

const isOnlyMatch = mapNumbers.size === 1
const isFirstMapWithoutScores = !scoreA && !scoreB && (mapNumber === 1 || maps[maps.length - 1]?.scores)
const isFirstMapWithoutScores = ! scoreA && ! scoreB && (mapNumber === 1 || maps[maps.length - 1]?.scores)

maps.push({
isOnlyMatch,
Expand Down
2 changes: 1 addition & 1 deletion src/themes/fennec/sidebars/sidebar/player/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default {

computed: {
isBombActive() {
return this.player?.weapons?.find((weapon) => weapon.isActive)?.isBomb
return !! this.player?.bomb?.isActive
},

positionClass() {
Expand Down
18 changes: 9 additions & 9 deletions src/themes/raw/gsi/parse-players.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ export const parsePlayers = () => Object.entries(gsiState.allplayers).map(([stea
forward: parsePosition(player.forward),
hasArmor: player.state?.armor > 0,
hasBadKdRatio: kdRatio <= options['preferences.maximumBadKdRatio'],
hasBomb: !!bomb,
hasDefuser: !!player.state?.defusekit,
hasBomb: !! bomb,
hasDefuser: !! player.state?.defusekit,
hasGoodKdRatio: kdRatio >= options['preferences.minimumGoodKdRatio'],
hasGrenades: grenades.length > 0,
hasHelmet: !!player.state?.helmet,
hasKnife: !!knife,
hasPrimary: !!primary,
hasSecondary: !!secondary,
hasTaser: !!taser,
hasHelmet: !! player.state?.helmet,
hasKnife: !! knife,
hasPrimary: !! primary,
hasSecondary: !! secondary,
hasTaser: !! taser,
health: player.state?.health,
isAlive: player.state?.health > 0,
isBurning: !!player.state?.burning, // TODO why is this a number instead of a boolean?
isFlashed: !!player.state?.flashed, // TODO why is this a number instead of a boolean?
isBurning: !! player.state?.burning, // TODO why is this a number instead of a boolean?
isFlashed: !! player.state?.flashed, // TODO why is this a number instead of a boolean?
isFocused: gsiState.player?.steamid === steam64Id,
kills: player.match_stats?.kills,
money: player.state?.money,
Expand Down

0 comments on commit 0367f0e

Please sign in to comment.