mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-09-08 17:51:20 +02:00
Remove remaining workbench references
This commit is contained in:
parent
9eae2573fd
commit
0169145212
@ -6,7 +6,7 @@ import {
|
|||||||
StirlingFileStub,
|
StirlingFileStub,
|
||||||
FileContextAction,
|
FileContextAction,
|
||||||
FileContextState,
|
FileContextState,
|
||||||
toWorkbenchFile,
|
toStirlingFileStub,
|
||||||
createFileId,
|
createFileId,
|
||||||
createQuickKey
|
createQuickKey
|
||||||
} from '../../types/fileContext';
|
} from '../../types/fileContext';
|
||||||
@ -163,7 +163,7 @@ export async function addFiles(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create record with immediate thumbnail and page metadata
|
// Create record with immediate thumbnail and page metadata
|
||||||
const record = toWorkbenchFile(file, fileId);
|
const record = toStirlingFileStub(file, fileId);
|
||||||
if (thumbnail) {
|
if (thumbnail) {
|
||||||
record.thumbnailUrl = thumbnail;
|
record.thumbnailUrl = thumbnail;
|
||||||
// Track blob URLs for cleanup (images return blob URLs that need revocation)
|
// Track blob URLs for cleanup (images return blob URLs that need revocation)
|
||||||
@ -205,7 +205,7 @@ export async function addFiles(
|
|||||||
const fileId = createFileId();
|
const fileId = createFileId();
|
||||||
filesRef.current.set(fileId, file);
|
filesRef.current.set(fileId, file);
|
||||||
|
|
||||||
const record = toWorkbenchFile(file, fileId);
|
const record = toStirlingFileStub(file, fileId);
|
||||||
if (thumbnail) {
|
if (thumbnail) {
|
||||||
record.thumbnailUrl = thumbnail;
|
record.thumbnailUrl = thumbnail;
|
||||||
// Track blob URLs for cleanup (images return blob URLs that need revocation)
|
// Track blob URLs for cleanup (images return blob URLs that need revocation)
|
||||||
@ -254,7 +254,7 @@ export async function addFiles(
|
|||||||
|
|
||||||
filesRef.current.set(fileId, file);
|
filesRef.current.set(fileId, file);
|
||||||
|
|
||||||
const record = toWorkbenchFile(file, fileId);
|
const record = toStirlingFileStub(file, fileId);
|
||||||
|
|
||||||
// Generate processedFile metadata for stored files
|
// Generate processedFile metadata for stored files
|
||||||
let pageCount: number = 1;
|
let pageCount: number = 1;
|
||||||
@ -347,7 +347,7 @@ async function processFilesIntoRecords(
|
|||||||
if (DEBUG) console.warn(`📄 Failed to generate thumbnail for file ${file.name}:`, error);
|
if (DEBUG) console.warn(`📄 Failed to generate thumbnail for file ${file.name}:`, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
const record = toWorkbenchFile(file, fileId);
|
const record = toStirlingFileStub(file, fileId);
|
||||||
if (thumbnail) {
|
if (thumbnail) {
|
||||||
record.thumbnailUrl = thumbnail;
|
record.thumbnailUrl = thumbnail;
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,10 @@ export function isFileObject(obj: any): obj is File | StirlingFile {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function toWorkbenchFile(file: File, id?: FileId): StirlingFileStub {
|
export function toStirlingFileStub(
|
||||||
|
file: File,
|
||||||
|
id?: FileId
|
||||||
|
): StirlingFileStub {
|
||||||
const fileId = id || createFileId();
|
const fileId = id || createFileId();
|
||||||
return {
|
return {
|
||||||
id: fileId,
|
id: fileId,
|
||||||
@ -350,6 +353,3 @@ export interface FileContextActionsValue {
|
|||||||
actions: FileContextActions;
|
actions: FileContextActions;
|
||||||
dispatch: (action: FileContextAction) => void;
|
dispatch: (action: FileContextAction) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: URL parameter types will be redesigned for new routing system
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user