Skip to content

Commit

Permalink
fix: maybe fix uicons stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtIeSocks committed Nov 24, 2023
1 parent 8c63a09 commit bb9cbde
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/hooks/useRefresh.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit bb9cbde

Please sign in to comment.