Use @ury1350/prettier-config

This commit is contained in:
Marks Polakovs 2020-04-19 18:49:59 +02:00
parent bcfd4004d7
commit abcac8107c
7 changed files with 51 additions and 21 deletions

View file

@ -124,6 +124,7 @@
]
},
"devDependencies": {
"@ury1350/prettier-config": "^1.0.0",
"node-sass": "^4.13.1",
"prettier": "^1.19.1"
},
@ -179,5 +180,6 @@
"presets": [
"react-app"
]
}
},
"prettier": "@ury1350/prettier-config"
}

View file

@ -64,7 +64,10 @@ export class WebRTCStreamer extends Streamer {
if (state === "CONNECTED") {
this.newsInterval = later.setInterval(
this.doTheNews,
later.parse.recur().on(59).minute()
later.parse
.recur()
.on(59)
.minute()
);
} else if (state === "CONNECTION_LOST" || state === "NOT_CONNECTED") {
this.newsInterval?.clear();
@ -107,14 +110,30 @@ export class WebRTCStreamer extends Streamer {
// Sanity check
const now = new Date();
if (now.getSeconds() < 45) {
later.setTimeout(async () => {
await MixerState.playNewsIntro();
}, later.parse.recur().on(59).minute().on(45).second());
later.setTimeout(
async () => {
await MixerState.playNewsIntro();
},
later.parse
.recur()
.on(59)
.minute()
.on(45)
.second()
);
}
if (now.getMinutes() <= 1 && now.getSeconds() < 55) {
later.setTimeout(async () => {
await MixerState.playNewsEnd();
}, later.parse.recur().on(1).minute().on(55).second());
later.setTimeout(
async () => {
await MixerState.playNewsEnd();
},
later.parse
.recur()
.on(1)
.minute()
.on(55)
.second()
);
}
}
}
@ -146,9 +165,9 @@ export class WebRTCStreamer extends Streamer {
}
// TODO: maybe delete non-Opus candidates?
}
track.fmtp[opusIndex].config += `; maxaveragebitrate=${
192 * 2 * 1024
}; stereo=1; sprop-stereo=1 ; cbr=1`;
track.fmtp[opusIndex].config += `; maxaveragebitrate=${192 *
2 *
1024}; stereo=1; sprop-stereo=1 ; cbr=1`;
});
offer.sdp = SdpTransform.write(parsed);

View file

@ -526,9 +526,15 @@ export const load = (
export const updateTimeEnding = (): AppThunk => async (dispatch) => {
if (!timerInterval) {
timerInterval = later.setInterval(() => {
dispatch(mixerState.actions.updateTimeEndingAt());
}, later.parse.recur().every(1).second());
timerInterval = later.setInterval(
() => {
dispatch(mixerState.actions.updateTimeEndingAt());
},
later.parse
.recur()
.every(1)
.second()
);
}
};
@ -604,7 +610,7 @@ export const {
} = mixerState.actions;
export const redrawWavesurfers = (): AppThunk => () => {
wavesurfers.forEach(function (item) {
wavesurfers.forEach(function(item) {
item.drawBuffer();
});
};

View file

@ -95,7 +95,7 @@ export function MicTab() {
disabled={micList === null}
>
<option value={"$NONE"} disabled label="Choose a microphone" />
{(micList || []).map(function (e, i) {
{(micList || []).map(function(e, i) {
return (
<option value={e.deviceId} key={i}>
{e.label !== "" ? e.label : e.deviceId}

View file

@ -5,7 +5,7 @@ import { MYRADIO_NON_API_BASE } from "../api";
import { useSelector, useDispatch } from "react-redux";
import { RootState } from "../rootReducer";
const SessionHandler: React.FC = function () {
const SessionHandler: React.FC = function() {
const dispatch = useDispatch();
useEffect(() => {

View file

@ -171,9 +171,7 @@ function incrReducer(state: number, action: any) {
return state + 1;
}
const Showplanner: React.FC<{ timeslotId: number }> = function ({
timeslotId,
}) {
const Showplanner: React.FC<{ timeslotId: number }> = function({ timeslotId }) {
const {
plan: showplan,
planLoadError,
@ -202,7 +200,7 @@ const Showplanner: React.FC<{ timeslotId: number }> = function ({
if (element) {
element.classList.toggle("active");
}
setTimeout(function () {
setTimeout(function() {
dispatch(MixerState.redrawWavesurfers());
}, 500);
}

View file

@ -1642,6 +1642,11 @@
semver "^6.3.0"
tsutils "^3.17.1"
"@ury1350/prettier-config@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@ury1350/prettier-config/-/prettier-config-1.0.0.tgz#c5c81d187c016a9692edbd25b3964b23132c9b06"
integrity sha512-U36sZLI1vf9BiVB9P1CRYgBCoS0lYqzpUb37Cy8sgjjQvg8XwfjA75fMjgIBS99uYRN/VtnRrNIm93OsvetVJw==
"@webassemblyjs/ast@1.8.5":
version "1.8.5"
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359"