prettier all the things
This commit is contained in:
parent
1203d90328
commit
552c56390c
4 changed files with 26 additions and 36 deletions
|
@ -12,7 +12,7 @@ export async function apiRequest(
|
||||||
params: any,
|
params: any,
|
||||||
need_auth: boolean = true
|
need_auth: boolean = true
|
||||||
): Promise<Response> {
|
): Promise<Response> {
|
||||||
var req: Promise<Response>| null = null;
|
var req: Promise<Response> | null = null;
|
||||||
if (method === "GET") {
|
if (method === "GET") {
|
||||||
req = fetch(url + qs.stringify(params, { addQueryPrefix: true }), {
|
req = fetch(url + qs.stringify(params, { addQueryPrefix: true }), {
|
||||||
credentials: need_auth ? "include" : "omit",
|
credentials: need_auth ? "include" : "omit",
|
||||||
|
|
|
@ -13,8 +13,8 @@ import { Track, MYRADIO_NON_API_BASE, AuxItem } from "../api";
|
||||||
import { AppThunk } from "../store";
|
import { AppThunk } from "../store";
|
||||||
import { RootState } from "../rootReducer";
|
import { RootState } from "../rootReducer";
|
||||||
import WaveSurfer from "wavesurfer.js";
|
import WaveSurfer from "wavesurfer.js";
|
||||||
import CursorPlugin from 'wavesurfer.js/dist/plugin/wavesurfer.cursor.min.js';
|
import CursorPlugin from "wavesurfer.js/dist/plugin/wavesurfer.cursor.min.js";
|
||||||
import RegionsPlugin from 'wavesurfer.js/dist/plugin/wavesurfer.regions.min.js';
|
import RegionsPlugin from "wavesurfer.js/dist/plugin/wavesurfer.regions.min.js";
|
||||||
import * as later from "later";
|
import * as later from "later";
|
||||||
import NewsIntro from "../assets/audio/NewsIntro.wav";
|
import NewsIntro from "../assets/audio/NewsIntro.wav";
|
||||||
import NewsEndCountdown from "../assets/audio/NewsEndCountdown.wav";
|
import NewsEndCountdown from "../assets/audio/NewsEndCountdown.wav";
|
||||||
|
@ -385,20 +385,18 @@ export const load = (
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
} as any,
|
} as any,
|
||||||
plugins: [
|
plugins: [
|
||||||
CursorPlugin.create(
|
CursorPlugin.create({
|
||||||
{
|
showTime: true,
|
||||||
showTime: true,
|
opacity: 1,
|
||||||
opacity: 1,
|
customShowTimeStyle: {
|
||||||
customShowTimeStyle: {
|
"background-color": "#000",
|
||||||
'background-color': '#000',
|
color: "#fff",
|
||||||
color: '#fff',
|
padding: "2px",
|
||||||
padding: '2px',
|
"font-size": "10px",
|
||||||
'font-size': '10px'
|
},
|
||||||
}
|
}),
|
||||||
}
|
RegionsPlugin.create({}),
|
||||||
),
|
],
|
||||||
RegionsPlugin.create({})
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
wavesurfer.on("ready", () => {
|
wavesurfer.on("ready", () => {
|
||||||
|
@ -421,15 +419,13 @@ export const load = (
|
||||||
wavesurfer.play();
|
wavesurfer.play();
|
||||||
}
|
}
|
||||||
if (state.loadedItem && "intro" in state.loadedItem) {
|
if (state.loadedItem && "intro" in state.loadedItem) {
|
||||||
wavesurfer.addRegion(
|
wavesurfer.addRegion({
|
||||||
{
|
id: "intro",
|
||||||
id: "intro",
|
resize: false,
|
||||||
resize: false,
|
start: 0,
|
||||||
start: 0,
|
end: state.loadedItem.intro,
|
||||||
end: state.loadedItem.intro,
|
color: "rgba(125,0,255, 0.12)",
|
||||||
color: 'rgba(125,0,255, 0.12)'
|
});
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
wavesurfer.on("play", () => {
|
wavesurfer.on("play", () => {
|
||||||
|
|
2
src/wavesurfer-plugins.d.ts
vendored
2
src/wavesurfer-plugins.d.ts
vendored
|
@ -1,3 +1,3 @@
|
||||||
declare module "wavesurfer.js/dist/plugin/wavesurfer.cursor.min.js";
|
declare module "wavesurfer.js/dist/plugin/wavesurfer.cursor.min.js";
|
||||||
|
|
||||||
declare module "wavesurfer.js/dist/plugin/wavesurfer.regions.min.js";
|
declare module "wavesurfer.js/dist/plugin/wavesurfer.regions.min.js";
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"lib": [
|
"lib": ["dom", "dom.iterable", "esnext"],
|
||||||
"dom",
|
|
||||||
"dom.iterable",
|
|
||||||
"esnext"
|
|
||||||
],
|
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
|
@ -17,9 +13,7 @@
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"jsx": "react",
|
"jsx": "react"
|
||||||
},
|
},
|
||||||
"include": [
|
"include": ["src"]
|
||||||
"src"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue