mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Replaced redux with zustand. Fixed login issue, closes #980.
This commit is contained in:
parent
7071f5fba5
commit
9937caa569
33 changed files with 234 additions and 286 deletions
|
|
@ -1,12 +1,10 @@
|
|||
import { useEffect, useCallback } from 'react';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import { checkVersion } from 'redux/actions/app';
|
||||
import useStore, { checkVersion } from 'store/version';
|
||||
import { VERSION_CHECK } from 'lib/constants';
|
||||
import { getItem, setItem } from 'lib/web';
|
||||
|
||||
export default function useVersion(check) {
|
||||
const dispatch = useDispatch();
|
||||
const versions = useSelector(state => state.app.versions);
|
||||
const versions = useStore();
|
||||
const checked = versions.latest === getItem(VERSION_CHECK)?.version;
|
||||
|
||||
const updateCheck = useCallback(() => {
|
||||
|
|
@ -15,7 +13,7 @@ export default function useVersion(check) {
|
|||
|
||||
useEffect(() => {
|
||||
if (check && !versions.latest) {
|
||||
dispatch(checkVersion());
|
||||
checkVersion();
|
||||
}
|
||||
}, [versions, check]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue