Skip to content

Commit

Permalink
fix(Docx): normalize in create file
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed Jun 22, 2022
1 parent 4d83f86 commit 6bf10ac
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions packages/better-write-plugin-docx/src/set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,18 +404,20 @@ export const PluginDocxSet = (

hooks.toast.info(hooks.i18n.t('toast.generics.load'))

docx.Packer.toBlob(doc)
.then((blob) => {
saveAs(blob, hooks.project.utils().exportFullName('docx'))
hooks.storage.normalize().then(() => {
docx.Packer.toBlob(doc)
.then((blob) => {
saveAs(blob, hooks.project.utils().exportFullName('docx'))

hooks.toast.success(hooks.i18n.t('toast.project.docx.generate'))
})
.finally(() => {
isLoading.value = false
})
.catch(() => {
hooks.toast.error(hooks.i18n.t('toast.generics.error'))
})
hooks.toast.success(hooks.i18n.t('toast.project.docx.generate'))
})
.finally(() => {
isLoading.value = false
})
.catch(() => {
hooks.toast.error(hooks.i18n.t('toast.generics.error'))
})
})
}

On.externals().PluginDocxGenerate(emitter, [
Expand Down

0 comments on commit 6bf10ac

Please sign in to comment.