Remove v3 updates from UI

This commit is contained in:
Mark McDowall 2025-10-06 06:48:38 +09:00
parent 46c9b98fad
commit 4ac61fc4c6
No known key found for this signature in database
3 changed files with 4 additions and 18 deletions

View file

@ -1,5 +1,5 @@
import React, { useCallback, useEffect } from 'react'; import React, { useCallback, useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import Button from 'Components/Link/Button'; import Button from 'Components/Link/Button';
import LoadingIndicator from 'Components/Loading/LoadingIndicator'; import LoadingIndicator from 'Components/Loading/LoadingIndicator';
import InlineMarkdown from 'Components/Markdown/InlineMarkdown'; import InlineMarkdown from 'Components/Markdown/InlineMarkdown';
@ -9,7 +9,6 @@ import ModalFooter from 'Components/Modal/ModalFooter';
import ModalHeader from 'Components/Modal/ModalHeader'; import ModalHeader from 'Components/Modal/ModalHeader';
import usePrevious from 'Helpers/Hooks/usePrevious'; import usePrevious from 'Helpers/Hooks/usePrevious';
import { kinds } from 'Helpers/Props'; import { kinds } from 'Helpers/Props';
import { fetchUpdates } from 'Store/Actions/systemActions';
import UpdateChanges from 'System/Updates/UpdateChanges'; import UpdateChanges from 'System/Updates/UpdateChanges';
import useUpdates from 'System/Updates/useUpdates'; import useUpdates from 'System/Updates/useUpdates';
import Update from 'typings/Update'; import Update from 'typings/Update';
@ -64,9 +63,8 @@ interface AppUpdatedModalContentProps {
} }
function AppUpdatedModalContent(props: AppUpdatedModalContentProps) { function AppUpdatedModalContent(props: AppUpdatedModalContentProps) {
const dispatch = useDispatch();
const { version, prevVersion } = useSelector((state: AppState) => state.app); const { version, prevVersion } = useSelector((state: AppState) => state.app);
const { isFetched, error, data } = useUpdates(); const { isFetched, error, data, refetch } = useUpdates();
const previousVersion = usePrevious(version); const previousVersion = usePrevious(version);
const { onModalClose } = props; const { onModalClose } = props;
@ -77,15 +75,11 @@ function AppUpdatedModalContent(props: AppUpdatedModalContentProps) {
window.location.href = `${window.Sonarr.urlBase}/system/updates`; window.location.href = `${window.Sonarr.urlBase}/system/updates`;
}, []); }, []);
useEffect(() => {
dispatch(fetchUpdates());
}, [dispatch]);
useEffect(() => { useEffect(() => {
if (version !== previousVersion) { if (version !== previousVersion) {
dispatch(fetchUpdates()); refetch();
} }
}, [version, previousVersion, dispatch]); }, [version, previousVersion, refetch]);
return ( return (
<ModalContent onModalClose={onModalClose}> <ModalContent onModalClose={onModalClose}>

View file

@ -80,8 +80,6 @@ export const RESTORE_BACKUP = 'system/backups/restoreBackup';
export const CLEAR_RESTORE_BACKUP = 'system/backups/clearRestoreBackup'; export const CLEAR_RESTORE_BACKUP = 'system/backups/clearRestoreBackup';
export const DELETE_BACKUP = 'system/backups/deleteBackup'; export const DELETE_BACKUP = 'system/backups/deleteBackup';
export const FETCH_UPDATES = 'system/updates/fetchUpdates';
export const RESTART = 'system/restart'; export const RESTART = 'system/restart';
export const SHUTDOWN = 'system/shutdown'; export const SHUTDOWN = 'system/shutdown';
@ -100,8 +98,6 @@ export const restoreBackup = createThunk(RESTORE_BACKUP);
export const clearRestoreBackup = createAction(CLEAR_RESTORE_BACKUP); export const clearRestoreBackup = createAction(CLEAR_RESTORE_BACKUP);
export const deleteBackup = createThunk(DELETE_BACKUP); export const deleteBackup = createThunk(DELETE_BACKUP);
export const fetchUpdates = createThunk(FETCH_UPDATES);
export const restart = createThunk(RESTART); export const restart = createThunk(RESTART);
export const shutdown = createThunk(SHUTDOWN); export const shutdown = createThunk(SHUTDOWN);
@ -180,8 +176,6 @@ export const actionHandlers = handleThunks({
[DELETE_BACKUP]: createRemoveItemHandler(backupsSection, '/system/backup'), [DELETE_BACKUP]: createRemoveItemHandler(backupsSection, '/system/backup'),
[FETCH_UPDATES]: createFetchHandler('system.updates', '/update'),
[RESTART]: function(getState, payload, dispatch) { [RESTART]: function(getState, payload, dispatch) {
const promise = createAjaxRequest({ const promise = createAjaxRequest({
url: '/system/restart', url: '/system/restart',

View file

@ -15,7 +15,6 @@ import { icons, kinds } from 'Helpers/Props';
import useUpdateSettings from 'Settings/General/useUpdateSettings'; import useUpdateSettings from 'Settings/General/useUpdateSettings';
import { executeCommand } from 'Store/Actions/commandActions'; import { executeCommand } from 'Store/Actions/commandActions';
import { fetchGeneralSettings } from 'Store/Actions/settingsActions'; import { fetchGeneralSettings } from 'Store/Actions/settingsActions';
import { fetchUpdates } from 'Store/Actions/systemActions';
import createCommandExecutingSelector from 'Store/Selectors/createCommandExecutingSelector'; import createCommandExecutingSelector from 'Store/Selectors/createCommandExecutingSelector';
import createSystemStatusSelector from 'Store/Selectors/createSystemStatusSelector'; import createSystemStatusSelector from 'Store/Selectors/createSystemStatusSelector';
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector'; import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
@ -114,7 +113,6 @@ function Updates() {
}, [setIsMajorUpdateModalOpen]); }, [setIsMajorUpdateModalOpen]);
useEffect(() => { useEffect(() => {
dispatch(fetchUpdates());
dispatch(fetchGeneralSettings()); dispatch(fetchGeneralSettings());
}, [dispatch]); }, [dispatch]);