1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-24 22:36:19 -04:00

Convert app state to zustand stores

This commit is contained in:
Mark McDowall
2025-12-02 17:56:14 -08:00
parent 66efb904f2
commit 878f879c40
26 changed files with 389 additions and 435 deletions
+2 -3
View File
@@ -1,5 +1,4 @@
import React, { useCallback, useEffect } from 'react';
import { useSelector } from 'react-redux';
import Button from 'Components/Link/Button';
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
import InlineMarkdown from 'Components/Markdown/InlineMarkdown';
@@ -13,7 +12,7 @@ import UpdateChanges from 'System/Updates/UpdateChanges';
import useUpdates from 'System/Updates/useUpdates';
import Update from 'typings/Update';
import translate from 'Utilities/String/translate';
import AppState from './State/AppState';
import { useAppValues } from './appStore';
import styles from './AppUpdatedModalContent.css';
function mergeUpdates(items: Update[], version: string, prevVersion?: string) {
@@ -63,7 +62,7 @@ interface AppUpdatedModalContentProps {
}
function AppUpdatedModalContent(props: AppUpdatedModalContentProps) {
const { version, prevVersion } = useSelector((state: AppState) => state.app);
const { version, prevVersion } = useAppValues('version', 'prevVersion');
const { isFetched, error, data, refetch } = useUpdates();
const previousVersion = usePrevious(version);