@@ -18,7 +18,7 @@ import {
1818import { copyToClipboard } from '$utils/dom' ;
1919import { SequenceCardStyle } from '$features/settings/styles.css' ;
2020import { AsyncStatus , useAsyncCallback } from '$hooks/useAsyncCallback' ;
21- import { getSvgCacheSize } from '$components/room-avatar/AvatarImage' ;
21+ import { getSvgCacheSize , clearSvgBlobCache } from '$components/room-avatar/AvatarImage' ;
2222import { SettingsSectionPage } from '../SettingsSectionPage' ;
2323import { AccountData } from './AccountData' ;
2424import { SyncDiagnostics } from './SyncDiagnostics' ;
@@ -75,6 +75,11 @@ export function DeveloperTools({ requestBack, requestClose }: DeveloperToolsProp
7575 setCacheStats ( getBlobCacheStats ( ) ) ;
7676 } , [ ] ) ;
7777
78+ const clearSvgCacheAction = useCallback ( ( ) => {
79+ clearSvgBlobCache ( ) ;
80+ setSvgCacheSize ( getSvgCacheSize ( ) ) ;
81+ } , [ ] ) ;
82+
7883 const [ clearSwCacheState , clearSwCacheAction ] = useAsyncCallback < void , Error , [ ] > (
7984 useCallback ( async ( ) => {
8085 await caches . delete ( 'sable-media-sw-v1' ) ;
@@ -288,6 +293,18 @@ export function DeveloperTools({ requestBack, requestClose }: DeveloperToolsProp
288293 focusId = "svg-cache"
289294 title = "SVG Avatar Cache"
290295 description = { `${ svgCacheSize } ${ svgCacheSize === 1 ? 'item' : 'items' } · processed SVG avatars, reused while app is open · cleared on reload` }
296+ after = {
297+ < Button
298+ onClick = { clearSvgCacheAction }
299+ variant = "Secondary"
300+ fill = "Soft"
301+ size = "300"
302+ radii = "300"
303+ outlined
304+ >
305+ < Text size = "B300" > Clear</ Text >
306+ </ Button >
307+ }
291308 />
292309 < SettingTile
293310 focusId = "clear-in-memory-cache"
0 commit comments