Format files

This commit is contained in:
Jordan Eldredge 2025-07-06 10:36:55 -07:00
parent 704112b333
commit 8eae420851
6 changed files with 48 additions and 15 deletions

View file

@ -31,7 +31,10 @@ const equalizer = (
): EqualizerState => {
switch (action.type) {
case "SET_BAND_VALUE":
const newSliders = { ...state.sliders, [(action as any).band]: (action as any).value };
const newSliders = {
...state.sliders,
[(action as any).band]: (action as any).value,
};
return { ...state, sliders: newSliders };
case "SET_EQ_ON":
return { ...state, on: true };

View file

@ -35,9 +35,15 @@ export const milkdrop = (
): MilkdropState => {
switch (action.type) {
case "SET_MILKDROP_DESKTOP":
return { ...state, display: (action as any).enabled ? "DESKTOP" : "WINDOW" };
return {
...state,
display: (action as any).enabled ? "DESKTOP" : "WINDOW",
};
case "SET_MILKDROP_FULLSCREEN":
return { ...state, display: (action as any).enabled ? "FULLSCREEN" : "WINDOW" };
return {
...state,
display: (action as any).enabled ? "FULLSCREEN" : "WINDOW",
};
case "GOT_BUTTERCHURN":
return { ...state, butterchurn: (action as any).butterchurn };
case "GOT_BUTTERCHURN_PRESETS":

View file

@ -118,7 +118,9 @@ const playlist = (
return { ...state, trackOrder };
case "ADD_TRACK_FROM_URL":
const atIndex =
(action as any).atIndex == null ? state.trackOrder.length : (action as any).atIndex;
(action as any).atIndex == null
? state.trackOrder.length
: (action as any).atIndex;
return {
...state,
trackOrder: [

View file

@ -22,7 +22,11 @@ export const userInput = (
case "SET_FOCUS":
return { ...state, focus: (action as any).input, bandFocused: null };
case "SET_BAND_FOCUS":
return { ...state, focus: (action as any).input, bandFocused: (action as any).bandFocused };
return {
...state,
focus: (action as any).input,
bandFocused: (action as any).bandFocused,
};
case "UNSET_FOCUS":
return { ...state, focus: null, bandFocused: null };
case "SET_SCRUB_POSITION":

View file

@ -111,7 +111,9 @@ const windows = (
let windowOrder = state.windowOrder;
if ((action as any).window != null) {
windowOrder = [
...state.windowOrder.filter((windowId) => windowId !== (action as any).window),
...state.windowOrder.filter(
(windowId) => windowId !== (action as any).window
),
(action as any).window,
];
}
@ -120,7 +122,9 @@ const windows = (
const { canShade } = state.genWindows[(action as any).windowId];
if (!canShade) {
throw new Error(
`Tried to shade/unshade a window that cannot be shaded: ${(action as any).windowId}`
`Tried to shade/unshade a window that cannot be shaded: ${
(action as any).windowId
}`
);
}
return {
@ -160,7 +164,9 @@ const windows = (
const { canResize } = state.genWindows[(action as any).windowId];
if (!canResize) {
throw new Error(
`Tried to resize a window that cannot be resized: ${(action as any).windowId}`
`Tried to resize a window that cannot be resized: ${
(action as any).windowId
}`
);
}
return {
@ -177,7 +183,9 @@ const windows = (
return {
...state,
positionsAreRelative:
(action as any).absolute === true ? false : state.positionsAreRelative,
(action as any).absolute === true
? false
: state.positionsAreRelative,
genWindows: Utils.objectMap(state.genWindows, (w, windowId) => {
const newPosition = (action as any).positions[windowId];
if (newPosition == null) {
@ -196,8 +204,8 @@ const windows = (
})),
};
case "LOAD_SERIALIZED_STATE": {
const { genWindows, focused, positionsAreRelative } =
(action as any).serializedState.windows;
const { genWindows, focused, positionsAreRelative } = (action as any)
.serializedState.windows;
return {
...state,
positionsAreRelative,
@ -216,7 +224,10 @@ const windows = (
case "BROWSER_WINDOW_SIZE_CHANGED":
return {
...state,
browserWindowSize: { height: (action as any).height, width: (action as any).width },
browserWindowSize: {
height: (action as any).height,
width: (action as any).width,
},
};
default:

View file

@ -158,7 +158,8 @@ class Webamp {
);
}
const handleOnline = () => this.store.dispatch({ type: "NETWORK_CONNECTED" });
const handleOnline = () =>
this.store.dispatch({ type: "NETWORK_CONNECTED" });
const handleOffline = () =>
this.store.dispatch({ type: "NETWORK_DISCONNECTED" });
@ -187,9 +188,15 @@ class Webamp {
"The misspelled option `avaliableSkins` is deprecated. Please use `availableSkins` instead."
);
// @ts-ignore
this.store.dispatch({ type: "SET_AVAILABLE_SKINS", skins: avaliableSkins });
this.store.dispatch({
type: "SET_AVAILABLE_SKINS",
skins: avaliableSkins,
});
} else if (availableSkins != null) {
this.store.dispatch({ type: "SET_AVAILABLE_SKINS", skins: availableSkins });
this.store.dispatch({
type: "SET_AVAILABLE_SKINS",
skins: availableSkins,
});
}
this.store.dispatch(Actions.setWindowLayout(options.windowLayout));