mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-26 19:47:30 +00:00
Clearn up unused dependencies
This commit is contained in:
parent
8c915f7f06
commit
50267f3ac2
17 changed files with 14 additions and 34 deletions
|
|
@ -113,7 +113,7 @@
|
|||
"no-unreachable": "error",
|
||||
"no-unused-expressions": "error",
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"warn",
|
||||
"error",
|
||||
{ "ignoreRestSiblings": true }
|
||||
],
|
||||
"no-use-before-define": ["error", "nofunc"],
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import WebampLazy from "../../js/webampLazy";
|
||||
import { LoadedURLTrack } from "../../js/types";
|
||||
|
||||
export default function enableMediaSession(webamp: WebampLazy) {
|
||||
if ("mediaSession" in navigator) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React from "react";
|
||||
import { connect, DispatchProp } from "react-redux";
|
||||
import { connect } from "react-redux";
|
||||
import classnames from "classnames";
|
||||
|
||||
import { toggleEq } from "../../actionCreators";
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ import {
|
|||
AppState,
|
||||
Dispatch,
|
||||
FilePicker,
|
||||
Track,
|
||||
} from "../../types";
|
||||
|
||||
interface StateProps {
|
||||
|
|
|
|||
|
|
@ -70,10 +70,9 @@ class MediaLibraryWindow extends React.Component<Props, State> {
|
|||
};
|
||||
|
||||
render() {
|
||||
const colors = this.props.skinGenExColors;
|
||||
return (
|
||||
<GenWindow title={"Winamp Library"} windowId={WINDOWS.MEDIA_LIBRARY}>
|
||||
{({ height, width }: { height: number; width: number }) => (
|
||||
{() => (
|
||||
<div
|
||||
id="webamp-media-library"
|
||||
style={{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ interface Props {
|
|||
}
|
||||
|
||||
const Background = (props: Props) => {
|
||||
const { innerRef, ...restProps } = props;
|
||||
const { innerRef } = props;
|
||||
return (
|
||||
<div
|
||||
ref={innerRef}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useEffect, useState, useCallback } from "react";
|
||||
import React, { useEffect } from "react";
|
||||
import Fullscreen from "../Fullscreen";
|
||||
import { connect } from "react-redux";
|
||||
import { useWindowSize, useScreenSize } from "../../hooks";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { AppState, Action, Dispatchable, Dispatch } from "../types";
|
||||
import { AppState, Dispatch } from "../types";
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import classnames from "classnames";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { Hr, Node, Parent } from "./ContextMenu";
|
||||
import { Hr, Node } from "./ContextMenu";
|
||||
import SkinsContextMenu from "./SkinsContextMenu";
|
||||
import { Dispatch, TimeMode, AppState } from "../types";
|
||||
import * as Actions from "../actionCreators";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import React from "react";
|
|||
import { connect } from "react-redux";
|
||||
import { removeAllTracks } from "../../actionCreators";
|
||||
import PlaylistMenu from "./PlaylistMenu";
|
||||
import { Dispatch } from "../../types";
|
||||
|
||||
/* eslint-disable no-alert */
|
||||
|
||||
|
|
@ -24,7 +23,7 @@ const ListMenu = (props: DispatchProps) => (
|
|||
</PlaylistMenu>
|
||||
);
|
||||
|
||||
const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => {
|
||||
const mapDispatchToProps = (): DispatchProps => {
|
||||
return { removeAllTracks };
|
||||
};
|
||||
export default connect(
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, { SFC } from "react";
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import {
|
||||
cropPlaylist,
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import { SELECT_ZERO } from "../../actionTypes";
|
|||
import { dragSelected, scrollPlaylistByDelta } from "../../actionCreators";
|
||||
import TrackCell from "./TrackCell";
|
||||
import TrackTitle from "./TrackTitle";
|
||||
import { Dispatch, AppState, PlaylistTrack } from "../../types";
|
||||
import { Dispatch, AppState } from "../../types";
|
||||
import { TracksState } from "../../reducers/tracks";
|
||||
|
||||
interface DispatchProps {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import { SET_FOCUSED_WINDOW } from "../../actionTypes";
|
|||
import {
|
||||
scrollUpFourTracks,
|
||||
scrollDownFourTracks,
|
||||
loadFilesFromReferences,
|
||||
togglePlaylistShadeMode,
|
||||
scrollVolume,
|
||||
closeWindow,
|
||||
|
|
@ -30,7 +29,7 @@ import TrackList from "./TrackList";
|
|||
import ScrollBar from "./ScrollBar";
|
||||
|
||||
import "../../../css/playlist-window.css";
|
||||
import { AppState, PlaylistStyle, Dispatch, LoadStyle } from "../../types";
|
||||
import { AppState, PlaylistStyle, Dispatch } from "../../types";
|
||||
|
||||
interface StateProps {
|
||||
offset: number;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ interface Size {
|
|||
}
|
||||
|
||||
export function useScreenSize() {
|
||||
const [size, setSize] = useState<Size>(Utils.getScreenSize());
|
||||
const [size] = useState<Size>(Utils.getScreenSize());
|
||||
// TODO: We could subscribe to screen size changes.
|
||||
return size;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import {
|
|||
SET_VOLUME,
|
||||
SET_BALANCE,
|
||||
SET_MEDIA,
|
||||
SET_MEDIA_TAGS,
|
||||
TOGGLE_REPEAT,
|
||||
TOGGLE_SHUFFLE,
|
||||
TOGGLE_TIME_MODE,
|
||||
|
|
|
|||
|
|
@ -80,10 +80,6 @@ function testSerialization<T>({
|
|||
});
|
||||
}
|
||||
|
||||
const defaultSerializedState = Selectors.getSerlializedState(
|
||||
getStore().getState()
|
||||
);
|
||||
|
||||
function getStore() {
|
||||
const extras = {};
|
||||
const enhancer = applyMiddleware(thunk.withExtraArgument(extras));
|
||||
|
|
|
|||
14
js/store.ts
14
js/store.ts
|
|
@ -7,14 +7,7 @@ import { merge } from "./utils";
|
|||
import { UPDATE_TIME_ELAPSED, STEP_MARQUEE } from "./actionTypes";
|
||||
import Media from "./media";
|
||||
import Emitter from "./emitter";
|
||||
import {
|
||||
Extras,
|
||||
MiddlewareStore,
|
||||
Dispatch,
|
||||
Action,
|
||||
AppState,
|
||||
Middleware,
|
||||
} from "./types";
|
||||
import { Extras, Dispatch, Action, AppState, Middleware } from "./types";
|
||||
|
||||
const compose = composeWithDevTools({
|
||||
actionsBlacklist: [UPDATE_TIME_ELAPSED, STEP_MARQUEE],
|
||||
|
|
@ -35,10 +28,7 @@ export default function(
|
|||
);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const emitterMiddleware = (store: MiddlewareStore) => (next: Dispatch) => (
|
||||
action: Action
|
||||
) => {
|
||||
const emitterMiddleware = () => (next: Dispatch) => (action: Action) => {
|
||||
actionEmitter.trigger(action.type, action);
|
||||
return next(action);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue