mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-21 09:09:01 +00:00
Ignore issue with Object.keys always returning string[]
This commit is contained in:
parent
8b2e2dd142
commit
342ac3dac9
2 changed files with 6 additions and 0 deletions
|
|
@ -28,6 +28,8 @@ export function cropPlaylist(): Dispatchable {
|
|||
} = getState();
|
||||
dispatch({
|
||||
type: REMOVE_TRACKS,
|
||||
// @ts-ignore The keys are numbers, but TypeScript does not trust us.
|
||||
// https://github.com/Microsoft/TypeScript/pull/12253#issuecomment-263132208
|
||||
ids: Object.keys(tracks).filter(id => !tracks[id].selected)
|
||||
});
|
||||
};
|
||||
|
|
@ -40,6 +42,8 @@ export function removeSelectedTracks(): Dispatchable {
|
|||
} = getState();
|
||||
dispatch({
|
||||
type: REMOVE_TRACKS,
|
||||
// @ts-ignore The keys are numbers, but TypeScript does not trust us.
|
||||
// https://github.com/Microsoft/TypeScript/pull/12253#issuecomment-263132208
|
||||
ids: Object.keys(tracks).filter(id => tracks[id].selected)
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -426,6 +426,8 @@ export interface PlaylistTrack {
|
|||
|
||||
export interface PlaylistState {
|
||||
trackOrder: number[];
|
||||
// https://github.com/Microsoft/TypeScript/pull/12253#issuecomment-263132208
|
||||
// TODO: Using numbers for keys is kinda annoying. Consider retyping as string
|
||||
tracks: { [id: number]: PlaylistTrack };
|
||||
lastSelectedIndex: number | null;
|
||||
currentTrack: number | null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue