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)) {