From 41a505513fb36f7c28c8d8a4270d5ee192169462 Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Sat, 8 Jul 2023 20:02:14 +0200 Subject: [PATCH] Remove unused `missed_update` state (#25832) --- app/javascript/mastodon/reducers/index.ts | 2 -- .../mastodon/reducers/missed_updates.ts | 33 ------------------- 2 files changed, 35 deletions(-) delete mode 100644 app/javascript/mastodon/reducers/missed_updates.ts diff --git a/app/javascript/mastodon/reducers/index.ts b/app/javascript/mastodon/reducers/index.ts index 67aa5f6c5e2..ad3077e37db 100644 --- a/app/javascript/mastodon/reducers/index.ts +++ b/app/javascript/mastodon/reducers/index.ts @@ -26,7 +26,6 @@ import lists from './lists'; import markers from './markers'; import media_attachments from './media_attachments'; import meta from './meta'; -import { missedUpdatesReducer } from './missed_updates'; import { modalReducer } from './modal'; import mutes from './mutes'; import notifications from './notifications'; @@ -82,7 +81,6 @@ const reducers = { suggestions, polls, trends, - missed_updates: missedUpdatesReducer, markers, picture_in_picture, history, diff --git a/app/javascript/mastodon/reducers/missed_updates.ts b/app/javascript/mastodon/reducers/missed_updates.ts deleted file mode 100644 index a587fcb0360..00000000000 --- a/app/javascript/mastodon/reducers/missed_updates.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Record } from 'immutable'; - -import type { Action } from 'redux'; - -import { focusApp, unfocusApp } from '../actions/app'; -import { NOTIFICATIONS_UPDATE } from '../actions/notifications'; - -interface MissedUpdatesState { - focused: boolean; - unread: number; -} -const initialState = Record({ - focused: true, - unread: 0, -})(); - -export function missedUpdatesReducer( - state = initialState, - action: Action -) { - switch (action.type) { - case focusApp.type: - return state.set('focused', true).set('unread', 0); - case unfocusApp.type: - return state.set('focused', false); - case NOTIFICATIONS_UPDATE: - return state.get('focused') - ? state - : state.update('unread', (x) => x + 1); - default: - return state; - } -}