From d913ca03443f3f7ca4b95580b737b2b364c23c33 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 30 Oct 2020 15:53:57 -0400 Subject: [PATCH] remove old subscription types --- flow-typed/Subscription.js | 137 --------------------------------- src/constants/subscriptions.js | 12 --- 2 files changed, 149 deletions(-) delete mode 100644 flow-typed/Subscription.js delete mode 100644 src/constants/subscriptions.js diff --git a/flow-typed/Subscription.js b/flow-typed/Subscription.js deleted file mode 100644 index 59db9fb..0000000 --- a/flow-typed/Subscription.js +++ /dev/null @@ -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, -}; - -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, - subscriptions: Array, - 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, - type?: SubscriptionNotificationType, - }, -}; - -declare type DoRemoveSubscriptionUnreads = { - type: ACTIONS.REMOVE_SUBSCRIPTION_UNREADS, - data: { - channel: string, - uris: Array, - }, -}; - -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, -}; - -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; diff --git a/src/constants/subscriptions.js b/src/constants/subscriptions.js deleted file mode 100644 index c636580..0000000 --- a/src/constants/subscriptions.js +++ /dev/null @@ -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';