supabase-cache-helpers icon indicating copy to clipboard operation
supabase-cache-helpers copied to clipboard

useDirectory and useDirectoryFileUrls use same key

Open geoguide opened this issue 1 year ago • 1 comments

Describe the bug I have a parent that I'm using useDirectoryFileUrls to show images in a folder in and then the child is using useDirectory to check for existance of the folder, but when I do so the url gets wiped on the parent and clears the image.

To Reproduce Make a parent that uses useDirectoryFileUrls with a child that uses useDirectory with the same folder.

Expected behavior The different methods should have different keys.

Additional context If there's a better way to conditionally remove a directory (I'm trying to clear the directory to replace the files in it in the child) that would suffice.

geoguide avatar Dec 09 '24 21:12 geoguide

can you share a snippet of what you want to achieve? Do you want to use the mutation hooks provide by the library to clear it?

psteinroe avatar Apr 19 '25 07:04 psteinroe

Crap I don't remember, we've been moving so fast. I'll try to dig in and find the example.

geoguide avatar Apr 25 '25 10:04 geoguide

Looked through our codebase and we're not using useDirectory any more so I replaced it with a new pattern we can close it and I'll reopen if I can create a gist or something that shows the issue.

geoguide avatar May 05 '25 13:05 geoguide