Fix ContentState type
This commit is contained in:
parent
1d61d80009
commit
96e704e5d9
3 changed files with 12 additions and 5 deletions
14
flow-typed/content.js
vendored
14
flow-typed/content.js
vendored
|
@ -2,13 +2,19 @@
|
|||
|
||||
declare type ContentState = {
|
||||
primaryUri: ?string,
|
||||
playingUri: {}, // Someone please fill in.
|
||||
playingUri: { uri?: string },
|
||||
positions: { [string]: { [string]: number } }, // claimId: { outpoint: position }
|
||||
history: Array<WatchHistory>,
|
||||
recommendationId: { [string]: string }, // claimId: recommendationId
|
||||
recommendationParentId: { [string]: string}, // claimId: referrerId
|
||||
recommendationUrls: { [string]: Array<string>}, // claimId: [lbryUrls...]
|
||||
recommendationClicks: { [string]: Array<number>}, // "claimId": [clicked indices...]
|
||||
recommendationParentId: { [string]: string }, // claimId: referrerId
|
||||
recommendationUrls: { [string]: Array<string> }, // claimId: [lbryUrls...]
|
||||
recommendationClicks: { [string]: Array<number> }, // "claimId": [clicked indices...]
|
||||
loopList?: { collectionId: string, loop: boolean },
|
||||
shuffleList?: { collectionId: string, newUrls: Array<string> | boolean },
|
||||
// TODO: it's confusing for newUrls to be a boolean --------- ^^^
|
||||
// It can/should be '?Array<string>` instead -- set it to null, then clients
|
||||
// can cast it to a boolean. That, or rename the variable to `shuffle` if you
|
||||
// don't care about the URLs.
|
||||
};
|
||||
|
||||
declare type WatchHistory = {
|
||||
|
|
|
@ -12,6 +12,7 @@ const defaultState: ContentState = {
|
|||
recommendationParentId: {},
|
||||
recommendationUrls: {},
|
||||
recommendationClicks: {},
|
||||
loopList: undefined,
|
||||
};
|
||||
|
||||
reducers[ACTIONS.SET_PRIMARY_URI] = (state, action) =>
|
||||
|
|
|
@ -18,7 +18,7 @@ import { FORCE_CONTENT_TYPE_PLAYER, FORCE_CONTENT_TYPE_COMIC } from 'constants/c
|
|||
const RECENT_HISTORY_AMOUNT = 10;
|
||||
const HISTORY_ITEMS_PER_PAGE = 50;
|
||||
|
||||
type State = { claims: any, content: any, user: UserState };
|
||||
type State = { claims: any, content: ContentState, user: UserState };
|
||||
|
||||
export const selectState = (state: State) => state.content || {};
|
||||
|
||||
|
|
Loading…
Reference in a new issue