better if/else readability

Co-authored-by: Ajay Ramachandran <dev@ajay.app>
This commit is contained in:
FlorianZahn
2021-10-13 06:14:03 +02:00
committed by GitHub
parent 2e254cb917
commit b18f631d33

View File

@@ -255,8 +255,12 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
// ctrl = 0.1 // ctrl = 0.1
// default = 0.01 // default = 0.01
// shift = 0.001 // shift = 0.001
if (e.shiftKey) step = (e.ctrlKey) ? 1 : 0.001; if (e.shiftKey) {
else step = (e.ctrlKey) ? 0.1 : 0.01; step = (e.ctrlKey) ? 1 : 0.001;
} else {
step = (e.ctrlKey) ? 0.1 : 0.01;
}
const sponsorTimeEdits = this.state.sponsorTimeEdits; const sponsorTimeEdits = this.state.sponsorTimeEdits;
let timeAsNumber = utils.getFormattedTimeToSeconds(this.state.sponsorTimeEdits[index]); let timeAsNumber = utils.getFormattedTimeToSeconds(this.state.sponsorTimeEdits[index]);
if (timeAsNumber !== null && e.deltaY != 0) { if (timeAsNumber !== null && e.deltaY != 0) {