From 4340311c94c10c6987f0e83f837f686d0830eb51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Wed, 23 Oct 2024 18:45:40 +0200 Subject: [PATCH] pl-fe: Remove unused exports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- packages/pl-fe/src/actions/importer/index.ts | 9 -------- packages/pl-fe/src/actions/modals.ts | 17 -------------- packages/pl-fe/src/actions/preload.ts | 1 - .../src/actions/push-notifications/index.ts | 23 ++----------------- .../src/actions/push-notifications/setter.ts | 12 +--------- .../pl-fe/src/actions/push-subscriptions.ts | 10 -------- packages/pl-fe/src/actions/statuses.ts | 9 -------- .../pl-fe/src/reducers/push-notifications.ts | 4 +--- 8 files changed, 4 insertions(+), 81 deletions(-) delete mode 100644 packages/pl-fe/src/actions/modals.ts diff --git a/packages/pl-fe/src/actions/importer/index.ts b/packages/pl-fe/src/actions/importer/index.ts index 3ea3632b1..c97486900 100644 --- a/packages/pl-fe/src/actions/importer/index.ts +++ b/packages/pl-fe/src/actions/importer/index.ts @@ -10,8 +10,6 @@ const STATUS_IMPORT = 'STATUS_IMPORT' as const; const STATUSES_IMPORT = 'STATUSES_IMPORT' as const; const POLLS_IMPORT = 'POLLS_IMPORT' as const; -const importAccount = (data: BaseAccount) => importAccounts([data]); - const importAccounts = (data: Array) => (dispatch: AppDispatch) => { try { const accounts = data.map(normalizeAccount); @@ -162,13 +160,6 @@ export { STATUS_IMPORT, STATUSES_IMPORT, POLLS_IMPORT, - importAccount, - importAccounts, - importGroup, - importGroups, - importStatus, - importStatuses, - importPolls, importFetchedAccount, importFetchedAccounts, importFetchedStatus, diff --git a/packages/pl-fe/src/actions/modals.ts b/packages/pl-fe/src/actions/modals.ts deleted file mode 100644 index 8b15c3e64..000000000 --- a/packages/pl-fe/src/actions/modals.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { useModalsStore } from 'pl-fe/stores/modals'; - -import type { ModalType } from 'pl-fe/features/ui/components/modal-root'; -import type { OpenModalProps } from 'pl-fe/stores/modals'; - -const openModal = (...props: OpenModalProps) => () => { - useModalsStore.getState().openModal(...props); -}; - -const closeModal = (type?: ModalType) => () => { - useModalsStore.getState().closeModal(type); -}; - -export { - openModal, - closeModal, -}; diff --git a/packages/pl-fe/src/actions/preload.ts b/packages/pl-fe/src/actions/preload.ts index 4b77263eb..29a212a66 100644 --- a/packages/pl-fe/src/actions/preload.ts +++ b/packages/pl-fe/src/actions/preload.ts @@ -68,7 +68,6 @@ export { PLEROMA_PRELOAD_IMPORT, MASTODON_PRELOAD_IMPORT, preload, - preloadPleroma, preloadMastodon, type PreloadAction, }; diff --git a/packages/pl-fe/src/actions/push-notifications/index.ts b/packages/pl-fe/src/actions/push-notifications/index.ts index 6fe35b844..f850f7f1f 100644 --- a/packages/pl-fe/src/actions/push-notifications/index.ts +++ b/packages/pl-fe/src/actions/push-notifications/index.ts @@ -1,25 +1,6 @@ -import { register, saveSettings } from './registerer'; -import { - SET_BROWSER_SUPPORT, - SET_SUBSCRIPTION, - CLEAR_SUBSCRIPTION, - SET_ALERTS, - setAlerts, -} from './setter'; - -import type { AppDispatch } from 'pl-fe/store'; - -const changeAlerts = (path: Array, value: any) => - (dispatch: AppDispatch) => { - dispatch(setAlerts(path, value)); - dispatch(saveSettings() as any); - }; - +export { register } from './registerer'; export { SET_BROWSER_SUPPORT, SET_SUBSCRIPTION, CLEAR_SUBSCRIPTION, - SET_ALERTS, - register, - changeAlerts, -}; +} from './setter'; diff --git a/packages/pl-fe/src/actions/push-notifications/setter.ts b/packages/pl-fe/src/actions/push-notifications/setter.ts index 046a18fb3..dfa931d4b 100644 --- a/packages/pl-fe/src/actions/push-notifications/setter.ts +++ b/packages/pl-fe/src/actions/push-notifications/setter.ts @@ -3,7 +3,6 @@ import type { WebPushSubscription } from 'pl-api'; const SET_BROWSER_SUPPORT = 'PUSH_NOTIFICATIONS_SET_BROWSER_SUPPORT' as const; const SET_SUBSCRIPTION = 'PUSH_NOTIFICATIONS_SET_SUBSCRIPTION' as const; const CLEAR_SUBSCRIPTION = 'PUSH_NOTIFICATIONS_CLEAR_SUBSCRIPTION' as const; -const SET_ALERTS = 'PUSH_NOTIFICATIONS_SET_ALERTS' as const; const setBrowserSupport = (value: boolean) => ({ type: SET_BROWSER_SUPPORT, @@ -19,26 +18,17 @@ const clearSubscription = () => ({ type: CLEAR_SUBSCRIPTION, }); -const setAlerts = (path: Array, value: any) => ({ - type: SET_ALERTS, - path, - value, -}); - type SetterAction = | ReturnType | ReturnType - | ReturnType - | ReturnType; + | ReturnType; export { SET_BROWSER_SUPPORT, SET_SUBSCRIPTION, CLEAR_SUBSCRIPTION, - SET_ALERTS, setBrowserSupport, setSubscription, clearSubscription, - setAlerts, type SetterAction, }; diff --git a/packages/pl-fe/src/actions/push-subscriptions.ts b/packages/pl-fe/src/actions/push-subscriptions.ts index 306fc5dfc..332f9bc42 100644 --- a/packages/pl-fe/src/actions/push-subscriptions.ts +++ b/packages/pl-fe/src/actions/push-subscriptions.ts @@ -7,21 +7,11 @@ const createPushSubscription = (params: CreatePushNotificationsSubscriptionParam (dispatch: AppDispatch, getState: () => RootState) => getClient(getState).pushNotifications.createSubscription(params); -const fetchPushSubscription = () => - (dispatch: AppDispatch, getState: () => RootState) => - getClient(getState).pushNotifications.getSubscription(); - const updatePushSubscription = (params: UpdatePushNotificationsSubscriptionParams) => (dispatch: AppDispatch, getState: () => RootState) => getClient(getState).pushNotifications.updateSubscription(params); -const deletePushSubscription = () => - (dispatch: AppDispatch, getState: () => RootState) => - getClient(getState).pushNotifications.deleteSubscription(); - export { createPushSubscription, - fetchPushSubscription, updatePushSubscription, - deletePushSubscription, }; diff --git a/packages/pl-fe/src/actions/statuses.ts b/packages/pl-fe/src/actions/statuses.ts index 0e9c78eae..54fca4893 100644 --- a/packages/pl-fe/src/actions/statuses.ts +++ b/packages/pl-fe/src/actions/statuses.ts @@ -273,14 +273,6 @@ const expandStatusSpoiler = (statusIds: string[] | string) => { }; }; -const toggleStatusSpoilerExpanded = (status: Pick) => { - if (status.expanded) { - return collapseStatusSpoiler(status.id); - } else { - return expandStatusSpoiler(status.id); - } -}; - let TRANSLATIONS_QUEUE: Set = new Set(); let TRANSLATIONS_TIMEOUT: NodeJS.Timeout | null = null; @@ -414,7 +406,6 @@ export { toggleStatusMediaHidden, expandStatusSpoiler, collapseStatusSpoiler, - toggleStatusSpoilerExpanded, translateStatus, undoStatusTranslation, unfilterStatus, diff --git a/packages/pl-fe/src/reducers/push-notifications.ts b/packages/pl-fe/src/reducers/push-notifications.ts index 8d33fbc83..0a05b476f 100644 --- a/packages/pl-fe/src/reducers/push-notifications.ts +++ b/packages/pl-fe/src/reducers/push-notifications.ts @@ -1,6 +1,6 @@ import { Map as ImmutableMap, Record as ImmutableRecord } from 'immutable'; -import { SET_BROWSER_SUPPORT, SET_SUBSCRIPTION, CLEAR_SUBSCRIPTION, SET_ALERTS } from '../actions/push-notifications'; +import { SET_BROWSER_SUPPORT, SET_SUBSCRIPTION, CLEAR_SUBSCRIPTION } from '../actions/push-notifications'; import type { SetterAction } from 'pl-fe/actions/push-notifications/setter'; @@ -39,8 +39,6 @@ const push_subscriptions = (state = ReducerRecord(), action: SetterAction) => { return state.set('browserSupport', action.value); case CLEAR_SUBSCRIPTION: return ReducerRecord(); - case SET_ALERTS: - return state.setIn(action.path, action.value); default: return state; }