pl-fe: Remove unused exports

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-10-23 18:45:40 +02:00
parent b3db562a32
commit 4340311c94
8 changed files with 4 additions and 81 deletions

View file

@ -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<BaseAccount>) => (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,

View file

@ -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,
};

View file

@ -68,7 +68,6 @@ export {
PLEROMA_PRELOAD_IMPORT,
MASTODON_PRELOAD_IMPORT,
preload,
preloadPleroma,
preloadMastodon,
type PreloadAction,
};

View file

@ -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<string>, 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';

View file

@ -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<string>, value: any) => ({
type: SET_ALERTS,
path,
value,
});
type SetterAction =
| ReturnType<typeof setBrowserSupport>
| ReturnType<typeof setSubscription>
| ReturnType<typeof clearSubscription>
| ReturnType<typeof setAlerts>;
| ReturnType<typeof clearSubscription>;
export {
SET_BROWSER_SUPPORT,
SET_SUBSCRIPTION,
CLEAR_SUBSCRIPTION,
SET_ALERTS,
setBrowserSupport,
setSubscription,
clearSubscription,
setAlerts,
type SetterAction,
};

View file

@ -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,
};

View file

@ -273,14 +273,6 @@ const expandStatusSpoiler = (statusIds: string[] | string) => {
};
};
const toggleStatusSpoilerExpanded = (status: Pick<Status, 'id' | 'expanded'>) => {
if (status.expanded) {
return collapseStatusSpoiler(status.id);
} else {
return expandStatusSpoiler(status.id);
}
};
let TRANSLATIONS_QUEUE: Set<string> = new Set();
let TRANSLATIONS_TIMEOUT: NodeJS.Timeout | null = null;
@ -414,7 +406,6 @@ export {
toggleStatusMediaHidden,
expandStatusSpoiler,
collapseStatusSpoiler,
toggleStatusSpoilerExpanded,
translateStatus,
undoStatusTranslation,
unfilterStatus,

View file

@ -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;
}