remove old subscription types
This commit is contained in:
parent
517c28a183
commit
d913ca0344
2 changed files with 0 additions and 149 deletions
137
flow-typed/Subscription.js
vendored
137
flow-typed/Subscription.js
vendored
|
@ -1,137 +0,0 @@
|
|||
// @flow
|
||||
import type { Dispatch } from 'flow-typed/Redux';
|
||||
import * as ACTIONS from 'constants/action_types';
|
||||
import {
|
||||
DOWNLOADED,
|
||||
DOWNLOADING,
|
||||
NOTIFY_ONLY,
|
||||
VIEW_ALL,
|
||||
VIEW_LATEST_FIRST,
|
||||
SUGGESTED_TOP_BID,
|
||||
SUGGESTED_TOP_SUBSCRIBED,
|
||||
SUGGESTED_FEATURED,
|
||||
} from 'constants/subscriptions';
|
||||
|
||||
declare type Subscription = {
|
||||
channelName: string, // @CryptoCandor,
|
||||
uri: string, // lbry://@CryptoCandor#9152f3b054f692076a6882d1b58a30e8781cc8e6
|
||||
latest?: string, // substratum#b0ab143243020e7831fd070d9f871e1fda948620
|
||||
};
|
||||
|
||||
// Tracking for new content
|
||||
// i.e. If a subscription has a DOWNLOADING type, we will trigger an OS notification
|
||||
// to tell users there is new content from their subscriptions
|
||||
declare type SubscriptionNotificationType = DOWNLOADED | DOWNLOADING | NOTIFY_ONLY;
|
||||
|
||||
declare type UnreadSubscription = {
|
||||
type: SubscriptionNotificationType,
|
||||
uris: Array<string>,
|
||||
};
|
||||
|
||||
declare type UnreadSubscriptions = {
|
||||
[string]: UnreadSubscription,
|
||||
};
|
||||
|
||||
declare type ViewMode = VIEW_LATEST_FIRST | VIEW_ALL;
|
||||
|
||||
declare type SuggestedType = SUGGESTED_TOP_BID | SUGGESTED_TOP_SUBSCRIBED | SUGGESTED_FEATURED;
|
||||
|
||||
declare type SuggestedSubscriptions = {
|
||||
[SuggestedType]: string,
|
||||
};
|
||||
|
||||
declare type SubscriptionState = {
|
||||
enabledChannelNotifications: Array<string>,
|
||||
subscriptions: Array<Subscription>,
|
||||
unread: UnreadSubscriptions,
|
||||
loading: boolean,
|
||||
viewMode: ViewMode,
|
||||
suggested: SuggestedSubscriptions,
|
||||
loadingSuggested: boolean,
|
||||
firstRunCompleted: boolean,
|
||||
showSuggestedSubs: boolean,
|
||||
};
|
||||
|
||||
//
|
||||
// Action types
|
||||
//
|
||||
declare type DoChannelSubscriptionEnableNotifications = {
|
||||
type: ACTIONS.CHANNEL_SUBSCRIPTION_ENABLE_NOTIFICATIONS,
|
||||
data: string,
|
||||
};
|
||||
|
||||
declare type DoChannelSubscriptionDisableNotifications = {
|
||||
type: ACTIONS.CHANNEL_SUBSCRIPTION_DISABLE_NOTIFICATIONS,
|
||||
data: string,
|
||||
};
|
||||
|
||||
declare type DoChannelSubscribe = {
|
||||
type: ACTIONS.CHANNEL_SUBSCRIBE,
|
||||
data: Subscription,
|
||||
};
|
||||
|
||||
declare type DoChannelUnsubscribe = {
|
||||
type: ACTIONS.CHANNEL_UNSUBSCRIBE,
|
||||
data: Subscription,
|
||||
};
|
||||
|
||||
declare type DoUpdateSubscriptionUnreads = {
|
||||
type: ACTIONS.UPDATE_SUBSCRIPTION_UNREADS,
|
||||
data: {
|
||||
channel: string,
|
||||
uris: Array<string>,
|
||||
type?: SubscriptionNotificationType,
|
||||
},
|
||||
};
|
||||
|
||||
declare type DoRemoveSubscriptionUnreads = {
|
||||
type: ACTIONS.REMOVE_SUBSCRIPTION_UNREADS,
|
||||
data: {
|
||||
channel: string,
|
||||
uris: Array<string>,
|
||||
},
|
||||
};
|
||||
|
||||
declare type SetSubscriptionLatest = {
|
||||
type: ACTIONS.SET_SUBSCRIPTION_LATEST,
|
||||
data: {
|
||||
subscription: Subscription,
|
||||
uri: string,
|
||||
},
|
||||
};
|
||||
|
||||
declare type CheckSubscriptionStarted = {
|
||||
type: ACTIONS.CHECK_SUBSCRIPTION_STARTED,
|
||||
};
|
||||
|
||||
declare type CheckSubscriptionCompleted = {
|
||||
type: ACTIONS.CHECK_SUBSCRIPTION_COMPLETED,
|
||||
};
|
||||
|
||||
declare type FetchedSubscriptionsSucess = {
|
||||
type: ACTIONS.FETCH_SUBSCRIPTIONS_SUCCESS,
|
||||
data: Array<Subscription>,
|
||||
};
|
||||
|
||||
declare type SetViewMode = {
|
||||
type: ACTIONS.SET_VIEW_MODE,
|
||||
data: ViewMode,
|
||||
};
|
||||
|
||||
declare type GetSuggestedSubscriptionsSuccess = {
|
||||
type: ACTIONS.GET_SUGGESTED_SUBSCRIPTIONS_START,
|
||||
data: SuggestedSubscriptions,
|
||||
};
|
||||
|
||||
declare type SubscriptionAction =
|
||||
| DoChannelSubscribe
|
||||
| DoChannelUnsubscribe
|
||||
| DoUpdateSubscriptionUnreads
|
||||
| DoRemoveSubscriptionUnreads
|
||||
| SetSubscriptionLatest
|
||||
| CheckSubscriptionStarted
|
||||
| CheckSubscriptionCompleted
|
||||
| SetViewMode
|
||||
| Function;
|
||||
|
||||
declare type SubscriptionDispatch = Dispatch<SubscriptionAction>;
|
|
@ -1,12 +0,0 @@
|
|||
export const VIEW_ALL = 'view_all';
|
||||
export const VIEW_LATEST_FIRST = 'view_latest_first';
|
||||
|
||||
// Types for unreads
|
||||
export const DOWNLOADING = 'DOWNLOADING';
|
||||
export const DOWNLOADED = 'DOWNLOADED';
|
||||
export const NOTIFY_ONLY = 'NOTIFY_ONLY;';
|
||||
|
||||
// Suggested types
|
||||
export const SUGGESTED_TOP_BID = 'top_bid';
|
||||
export const SUGGESTED_TOP_SUBSCRIBED = 'top_subscribed';
|
||||
export const SUGGESTED_FEATURED = 'featured';
|
Loading…
Reference in a new issue