mirror of
https://github.com/diced/zipline.git
synced 2026-04-28 10:43:06 -07:00
fix: blob urls not persisting
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useUserStore } from '@/lib/client/store/user';
|
||||
import type { File as DbFile } from '@/lib/db/models/file';
|
||||
import { useEffect, useMemo } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
export function appendPassword(url: string, password?: string | null) {
|
||||
return `${url}${password ? `?pw=${encodeURIComponent(password)}` : ''}`;
|
||||
@@ -19,12 +19,6 @@ export default function useFileUrls({ file, password }: { file: DbFile | File; p
|
||||
|
||||
const blobUrl = useMemo(() => (isDbFile(file) ? null : URL.createObjectURL(file as File)), [file]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!blobUrl) return;
|
||||
|
||||
return () => URL.revokeObjectURL(blobUrl);
|
||||
}, [blobUrl]);
|
||||
|
||||
return useMemo(() => {
|
||||
if (!isDbFile(file)) {
|
||||
return { fileUrl: blobUrl ?? '', thumbnailUrl: null, viewUrl: null };
|
||||
|
||||
Reference in New Issue
Block a user