fix(app): populate all fig pages on open
This commit is contained in:
parent
eb7a663c1c
commit
7f7b000ff0
|
|
@ -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, '')
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue