From bb9cbde0cb5505cbf813440ea7299db2cc08b1d8 Mon Sep 17 00:00:00 2001 From: Derick M <58572875+TurtIeSocks@users.noreply.github.com> Date: Fri, 24 Nov 2023 17:14:10 -0500 Subject: [PATCH] fix: maybe fix uicons stuff --- src/hooks/useRefresh.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hooks/useRefresh.js b/src/hooks/useRefresh.js index 480a92473..fc48b043c 100644 --- a/src/hooks/useRefresh.js +++ b/src/hooks/useRefresh.js @@ -3,8 +3,8 @@ import { useEffect } from 'react' import { useQuery } from '@apollo/client' import getAvailable from '@services/queries/available' -import UIcons from '@services/Icons' import { deepMerge } from '@services/functions/deepMerge' +import UIcons from '@services/Icons' import { useStatic, useStore } from './useStore' @@ -36,10 +36,11 @@ export default function useRefresh() { if (data?.available) { const { masterfile, filters, icons, ...rest } = data.available const { icons: userIcons } = useStore.getState() - const Icons = new UIcons(icons, masterfile.questRewardTypes) + const existing = useStatic.getState().Icons + const Icons = existing ?? new UIcons(icons, masterfile.questRewardTypes) if (Icons) { Icons.build(icons.styles) - if (icons.defaultIcons) { + if (icons.defaultIcons && !existing) { Icons.setSelection(icons.defaultIcons) } if (Icons.checkValid(userIcons)) {