pl-fe: Remove unused exports
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
b3db562a32
commit
4340311c94
8 changed files with 4 additions and 81 deletions
|
@ -10,8 +10,6 @@ const STATUS_IMPORT = 'STATUS_IMPORT' as const;
|
||||||
const STATUSES_IMPORT = 'STATUSES_IMPORT' as const;
|
const STATUSES_IMPORT = 'STATUSES_IMPORT' as const;
|
||||||
const POLLS_IMPORT = 'POLLS_IMPORT' as const;
|
const POLLS_IMPORT = 'POLLS_IMPORT' as const;
|
||||||
|
|
||||||
const importAccount = (data: BaseAccount) => importAccounts([data]);
|
|
||||||
|
|
||||||
const importAccounts = (data: Array<BaseAccount>) => (dispatch: AppDispatch) => {
|
const importAccounts = (data: Array<BaseAccount>) => (dispatch: AppDispatch) => {
|
||||||
try {
|
try {
|
||||||
const accounts = data.map(normalizeAccount);
|
const accounts = data.map(normalizeAccount);
|
||||||
|
@ -162,13 +160,6 @@ export {
|
||||||
STATUS_IMPORT,
|
STATUS_IMPORT,
|
||||||
STATUSES_IMPORT,
|
STATUSES_IMPORT,
|
||||||
POLLS_IMPORT,
|
POLLS_IMPORT,
|
||||||
importAccount,
|
|
||||||
importAccounts,
|
|
||||||
importGroup,
|
|
||||||
importGroups,
|
|
||||||
importStatus,
|
|
||||||
importStatuses,
|
|
||||||
importPolls,
|
|
||||||
importFetchedAccount,
|
importFetchedAccount,
|
||||||
importFetchedAccounts,
|
importFetchedAccounts,
|
||||||
importFetchedStatus,
|
importFetchedStatus,
|
||||||
|
|
|
@ -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,
|
|
||||||
};
|
|
|
@ -68,7 +68,6 @@ export {
|
||||||
PLEROMA_PRELOAD_IMPORT,
|
PLEROMA_PRELOAD_IMPORT,
|
||||||
MASTODON_PRELOAD_IMPORT,
|
MASTODON_PRELOAD_IMPORT,
|
||||||
preload,
|
preload,
|
||||||
preloadPleroma,
|
|
||||||
preloadMastodon,
|
preloadMastodon,
|
||||||
type PreloadAction,
|
type PreloadAction,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,25 +1,6 @@
|
||||||
import { register, saveSettings } from './registerer';
|
export { register } 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 {
|
export {
|
||||||
SET_BROWSER_SUPPORT,
|
SET_BROWSER_SUPPORT,
|
||||||
SET_SUBSCRIPTION,
|
SET_SUBSCRIPTION,
|
||||||
CLEAR_SUBSCRIPTION,
|
CLEAR_SUBSCRIPTION,
|
||||||
SET_ALERTS,
|
} from './setter';
|
||||||
register,
|
|
||||||
changeAlerts,
|
|
||||||
};
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ import type { WebPushSubscription } from 'pl-api';
|
||||||
const SET_BROWSER_SUPPORT = 'PUSH_NOTIFICATIONS_SET_BROWSER_SUPPORT' as const;
|
const SET_BROWSER_SUPPORT = 'PUSH_NOTIFICATIONS_SET_BROWSER_SUPPORT' as const;
|
||||||
const SET_SUBSCRIPTION = 'PUSH_NOTIFICATIONS_SET_SUBSCRIPTION' as const;
|
const SET_SUBSCRIPTION = 'PUSH_NOTIFICATIONS_SET_SUBSCRIPTION' as const;
|
||||||
const CLEAR_SUBSCRIPTION = 'PUSH_NOTIFICATIONS_CLEAR_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) => ({
|
const setBrowserSupport = (value: boolean) => ({
|
||||||
type: SET_BROWSER_SUPPORT,
|
type: SET_BROWSER_SUPPORT,
|
||||||
|
@ -19,26 +18,17 @@ const clearSubscription = () => ({
|
||||||
type: CLEAR_SUBSCRIPTION,
|
type: CLEAR_SUBSCRIPTION,
|
||||||
});
|
});
|
||||||
|
|
||||||
const setAlerts = (path: Array<string>, value: any) => ({
|
|
||||||
type: SET_ALERTS,
|
|
||||||
path,
|
|
||||||
value,
|
|
||||||
});
|
|
||||||
|
|
||||||
type SetterAction =
|
type SetterAction =
|
||||||
| ReturnType<typeof setBrowserSupport>
|
| ReturnType<typeof setBrowserSupport>
|
||||||
| ReturnType<typeof setSubscription>
|
| ReturnType<typeof setSubscription>
|
||||||
| ReturnType<typeof clearSubscription>
|
| ReturnType<typeof clearSubscription>;
|
||||||
| ReturnType<typeof setAlerts>;
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
SET_BROWSER_SUPPORT,
|
SET_BROWSER_SUPPORT,
|
||||||
SET_SUBSCRIPTION,
|
SET_SUBSCRIPTION,
|
||||||
CLEAR_SUBSCRIPTION,
|
CLEAR_SUBSCRIPTION,
|
||||||
SET_ALERTS,
|
|
||||||
setBrowserSupport,
|
setBrowserSupport,
|
||||||
setSubscription,
|
setSubscription,
|
||||||
clearSubscription,
|
clearSubscription,
|
||||||
setAlerts,
|
|
||||||
type SetterAction,
|
type SetterAction,
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,21 +7,11 @@ const createPushSubscription = (params: CreatePushNotificationsSubscriptionParam
|
||||||
(dispatch: AppDispatch, getState: () => RootState) =>
|
(dispatch: AppDispatch, getState: () => RootState) =>
|
||||||
getClient(getState).pushNotifications.createSubscription(params);
|
getClient(getState).pushNotifications.createSubscription(params);
|
||||||
|
|
||||||
const fetchPushSubscription = () =>
|
|
||||||
(dispatch: AppDispatch, getState: () => RootState) =>
|
|
||||||
getClient(getState).pushNotifications.getSubscription();
|
|
||||||
|
|
||||||
const updatePushSubscription = (params: UpdatePushNotificationsSubscriptionParams) =>
|
const updatePushSubscription = (params: UpdatePushNotificationsSubscriptionParams) =>
|
||||||
(dispatch: AppDispatch, getState: () => RootState) =>
|
(dispatch: AppDispatch, getState: () => RootState) =>
|
||||||
getClient(getState).pushNotifications.updateSubscription(params);
|
getClient(getState).pushNotifications.updateSubscription(params);
|
||||||
|
|
||||||
const deletePushSubscription = () =>
|
|
||||||
(dispatch: AppDispatch, getState: () => RootState) =>
|
|
||||||
getClient(getState).pushNotifications.deleteSubscription();
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
createPushSubscription,
|
createPushSubscription,
|
||||||
fetchPushSubscription,
|
|
||||||
updatePushSubscription,
|
updatePushSubscription,
|
||||||
deletePushSubscription,
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -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_QUEUE: Set<string> = new Set();
|
||||||
let TRANSLATIONS_TIMEOUT: NodeJS.Timeout | null = null;
|
let TRANSLATIONS_TIMEOUT: NodeJS.Timeout | null = null;
|
||||||
|
|
||||||
|
@ -414,7 +406,6 @@ export {
|
||||||
toggleStatusMediaHidden,
|
toggleStatusMediaHidden,
|
||||||
expandStatusSpoiler,
|
expandStatusSpoiler,
|
||||||
collapseStatusSpoiler,
|
collapseStatusSpoiler,
|
||||||
toggleStatusSpoilerExpanded,
|
|
||||||
translateStatus,
|
translateStatus,
|
||||||
undoStatusTranslation,
|
undoStatusTranslation,
|
||||||
unfilterStatus,
|
unfilterStatus,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Map as ImmutableMap, Record as ImmutableRecord } from 'immutable';
|
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';
|
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);
|
return state.set('browserSupport', action.value);
|
||||||
case CLEAR_SUBSCRIPTION:
|
case CLEAR_SUBSCRIPTION:
|
||||||
return ReducerRecord();
|
return ReducerRecord();
|
||||||
case SET_ALERTS:
|
|
||||||
return state.setIn(action.path, action.value);
|
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue