| @@ -2,8 +2,9 @@ | ||
| 2 | 2 | useImageAcquisition, |
| 3 | 3 | useUnsplashSearch, |
| 4 | 4 | } from '@agent/hooks/useImageAcquisition'; |
| 5 | 5 | import { preloadImage } from '@agent/lib/replace-image'; |
| 6 | +import { useImageCreditsSync } from '@shared/hooks/useImageCreditsSync'; | |
| 6 | 7 | import { useStampedPreview } from '@shared/hooks/useStampedPreview'; |
| 7 | 8 | import { |
| 8 | 9 | addCustomMediaViewsCss, |
| 9 | 10 | removeCustomMediaViewsCss, |
| @@ -58,8 +59,11 @@ | ||
| 58 | 59 | } = useImageAcquisition({ |
| 59 | 60 | source: 'agent', |
| 60 | 61 | onUrlReady: (_key, url) => applyPreview(url), |
| 61 | 62 | }); |
| 63 | + | |
| 64 | + useImageCreditsSync(); | |
| 65 | + | |
| 62 | 66 | const state = states[source]; |
| 63 | 67 | const ready = state?.status === 'ready'; |
| 64 | 68 | const activeUrl = state?.image?.url ?? state?.url ?? null; |
| 65 | 69 | const previewUrl = useStampedPreview( |