diff --git a/app/soapbox/actions/accounts.ts b/app/soapbox/actions/accounts.ts index e3767c7b8..60cb6bbe6 100644 --- a/app/soapbox/actions/accounts.ts +++ b/app/soapbox/actions/accounts.ts @@ -410,7 +410,6 @@ const unmuteAccountFail = (error: AxiosError) => ({ error, }); - const subscribeAccount = (id: string, notifications?: boolean) => (dispatch: AppDispatch, getState: () => RootState) => { if (!isLoggedIn(getState)) return null; @@ -465,7 +464,6 @@ const unsubscribeAccountFail = (error: AxiosError) => ({ error, }); - const removeFromFollowers = (id: string) => (dispatch: AppDispatch, getState: () => RootState) => { if (!isLoggedIn(getState)) return; @@ -771,7 +769,6 @@ const authorizeFollowRequestFail = (id: string, error: AxiosError) => ({ error, }); - const rejectFollowRequest = (id: string) => (dispatch: AppDispatch, getState: () => RootState) => { if (!isLoggedIn(getState)) return; diff --git a/app/soapbox/actions/auth.ts b/app/soapbox/actions/auth.ts index 54473346c..40532a582 100644 --- a/app/soapbox/actions/auth.ts +++ b/app/soapbox/actions/auth.ts @@ -269,7 +269,6 @@ export const fetchOwnAccounts = () => }); }; - export const register = (params: Record) => (dispatch: AppDispatch) => { params.fullname = params.username; diff --git a/app/soapbox/actions/filters.ts b/app/soapbox/actions/filters.ts index 16bb23951..61b4e9b63 100644 --- a/app/soapbox/actions/filters.ts +++ b/app/soapbox/actions/filters.ts @@ -65,7 +65,6 @@ const createFilter = (phrase: string, expires_at: string, context: Array }); }; - const deleteFilter = (id: string) => (dispatch: AppDispatch, getState: () => RootState) => { dispatch({ type: FILTERS_DELETE_REQUEST }); diff --git a/app/soapbox/actions/media.ts b/app/soapbox/actions/media.ts index 1a63d87d5..15c637c35 100644 --- a/app/soapbox/actions/media.ts +++ b/app/soapbox/actions/media.ts @@ -22,14 +22,12 @@ const uploadMediaV1 = (data: FormData, onUploadProgress = noOp) => onUploadProgress: onUploadProgress, }); - const uploadMediaV2 = (data: FormData, onUploadProgress = noOp) => (dispatch: any, getState: () => RootState) => api(getState).post('/api/v2/media', data, { onUploadProgress: onUploadProgress, }); - const uploadMedia = (data: FormData, onUploadProgress = noOp) => (dispatch: AppDispatch, getState: () => RootState) => { const state = getState(); diff --git a/app/soapbox/actions/moderation.tsx b/app/soapbox/actions/moderation.tsx index 946157071..69342277b 100644 --- a/app/soapbox/actions/moderation.tsx +++ b/app/soapbox/actions/moderation.tsx @@ -162,7 +162,6 @@ const deleteStatusModal = (intl: IntlShape, statusId: string, afterConfirm = () })); }; - export { deactivateUserModal, deleteUserModal, diff --git a/app/soapbox/actions/push_notifications/registerer.ts b/app/soapbox/actions/push_notifications/registerer.ts index b8d12caa4..893814b02 100644 --- a/app/soapbox/actions/push_notifications/registerer.ts +++ b/app/soapbox/actions/push_notifications/registerer.ts @@ -38,7 +38,7 @@ const unsubscribe = ({ registration, subscription }: { const sendSubscriptionToBackend = (subscription: PushSubscription, me: Me) => (dispatch: AppDispatch, getState: () => RootState) => { - const alerts = getState().push_notifications.get('alerts').toJS(); + const alerts = getState().push_notifications.alerts.toJS(); const params = { subscription, data: { alerts } }; if (me) { @@ -82,7 +82,7 @@ const register = () => // We have a subscription, check if it is still valid const currentServerKey = (new Uint8Array(subscription.options.applicationServerKey!)).toString(); const subscriptionServerKey = urlBase64ToUint8Array(vapidKey).toString(); - const serverEndpoint = getState().push_notifications.getIn(['subscription', 'endpoint']); + const serverEndpoint = getState().push_notifications.subscription?.endpoint; // If the VAPID public key did not change and the endpoint corresponds // to the endpoint saved in the backend, the subscription is valid @@ -136,7 +136,7 @@ const register = () => const saveSettings = () => (dispatch: AppDispatch, getState: () => RootState) => { const state = getState().push_notifications; - const alerts = state.get('alerts'); + const alerts = state.alerts; const data = { alerts }; const me = getState().me; diff --git a/app/soapbox/actions/statuses.ts b/app/soapbox/actions/statuses.ts index f0a6aad15..5cf534446 100644 --- a/app/soapbox/actions/statuses.ts +++ b/app/soapbox/actions/statuses.ts @@ -242,7 +242,6 @@ const fetchStatusWithContext = (id: string) => } }; - const muteStatus = (id: string) => (dispatch: AppDispatch, getState: () => RootState) => { if (!isLoggedIn(getState)) return; diff --git a/app/soapbox/actions/timelines.ts b/app/soapbox/actions/timelines.ts index ec8615def..5d7fac2c4 100644 --- a/app/soapbox/actions/timelines.ts +++ b/app/soapbox/actions/timelines.ts @@ -82,7 +82,7 @@ const updateTimelineQueue = (timeline: string, statusId: string, accept: ((statu const dequeueTimeline = (timelineId: string, expandFunc?: (lastStatusId: string) => void, optionalExpandArgs?: any) => (dispatch: AppDispatch, getState: () => RootState) => { const state = getState(); - const queuedCount = state.timelines.getIn([timelineId, 'totalQueuedItemsCount'], 0); + const queuedCount = state.timelines.get(timelineId)?.totalQueuedItemsCount || 0; if (queuedCount <= 0) return; @@ -136,16 +136,16 @@ const parseTags = (tags: Record = {}, mode: 'any' | 'all' | 'none const expandTimeline = (timelineId: string, path: string, params: Record = {}, done = noOp) => (dispatch: AppDispatch, getState: () => RootState) => { - const timeline = getState().timelines.get(timelineId) || ImmutableMap(); + const timeline = getState().timelines.get(timelineId) || {} as Record; const isLoadingMore = !!params.max_id; - if (timeline.get('isLoading')) { + if (timeline.isLoading) { done(); return dispatch(noOpAsync()); } - if (!params.max_id && !params.pinned && timeline.get('items', ImmutableOrderedSet()).size > 0) { - params.since_id = timeline.getIn(['items', 0]); + if (!params.max_id && !params.pinned && (timeline.items || ImmutableOrderedSet()).size > 0) { + params.since_id = timeline.items || 0; } const isLoadingRecent = !!params.since_id; diff --git a/app/soapbox/actions/verification.ts b/app/soapbox/actions/verification.ts index bc8db0189..ce3d27009 100644 --- a/app/soapbox/actions/verification.ts +++ b/app/soapbox/actions/verification.ts @@ -59,7 +59,6 @@ const removeStoredVerification = () => { localStorage.removeItem(LOCAL_STORAGE_VERIFICATION_KEY); }; - /** * Fetch and return the Registration token for Pepe. */ @@ -207,7 +206,6 @@ const fetchRegistrationToken = () => return null; } - return api(getState).post('/api/v1/pepe/registrations') .then(response => { updateStorage({ token: response.data.access_token }); diff --git a/app/soapbox/components/error_boundary.tsx b/app/soapbox/components/error_boundary.tsx index 6df25cb9d..c1025d465 100644 --- a/app/soapbox/components/error_boundary.tsx +++ b/app/soapbox/components/error_boundary.tsx @@ -171,7 +171,6 @@ class ErrorBoundary extends React.PureComponent { /> )} - {browser && ( diff --git a/app/soapbox/components/ui/modal/modal.tsx b/app/soapbox/components/ui/modal/modal.tsx index b019d01e3..3987d6afe 100644 --- a/app/soapbox/components/ui/modal/modal.tsx +++ b/app/soapbox/components/ui/modal/modal.tsx @@ -128,7 +128,6 @@ const Modal: React.FC = ({ )} -
{secondaryAction && (