fix(app): populate all fig pages on open

This commit is contained in:
Danila Poyarkov 2026-05-18 20:16:47 +03:00
parent eb7a663c1c
commit 7f7b000ff0
3 changed files with 4 additions and 4 deletions

View file

@ -44,7 +44,7 @@ export function createOpenActions({
try {
state.loading = true
await yieldToUI()
const imported = await readFigFile(file, { populate: 'first-page' })
const imported = await readFigFile(file)
await yieldToUI()
await applyImportedDocument(editor, imported)
state.documentName = file.name.replace(/\.fig$/i, '')

View file

@ -18,12 +18,12 @@ export async function readReloadSource({
const bytes = await tauriRead(filePath)
const blob = new Blob([bytes])
const file = new File([blob], `${documentName}.fig`)
return readFigFile(file, { populate: 'first-page' })
return readFigFile(file)
}
if (fileHandle) {
const file = await fileHandle.getFile()
return readFigFile(file, { populate: 'first-page' })
return readFigFile(file)
}
return null

View file

@ -108,7 +108,7 @@ export async function openFileInNewTab(
try {
const isFig = file.name.toLowerCase().endsWith('.fig')
const { graph: imported, sourceFormat } = isFig
? { graph: await readFigFile(file, { populate: 'first-page' }), sourceFormat: 'fig' }
? { graph: await readFigFile(file), sourceFormat: 'fig' }
: await io.readDocument({
name: file.name,
mimeType: file.type || undefined,