[feat]: actually include version checks

This commit is contained in:
Kendall Garner 2024-02-17 00:57:10 -08:00
commit dae2f9bd0a
No known key found for this signature in database
GPG key ID: 18D2767419676C87
36 changed files with 224 additions and 222 deletions

View file

@ -3,6 +3,7 @@ import { useAuthStoreActions, useCurrentServer } from '/@/renderer/store';
import { useQuery } from '@tanstack/react-query';
import { queryKeys } from '/@/renderer/api/query-keys';
import { controller } from '/@/renderer/api/controller';
import isEqual from 'lodash/isEqual';
export const useServerVersion = () => {
const { updateServer } = useAuthStoreActions();
@ -24,7 +25,7 @@ export const useServerVersion = () => {
useEffect(() => {
if (server && server.id === serverInfo.data?.id) {
const { version, features } = serverInfo.data;
if (version !== server.version) {
if (version !== server.version || !isEqual(features, server.features)) {
updateServer(server.id, {
features,
version,