Skip to content

Commit

Permalink
manually import workerError handler because apparently I can't trust …
Browse files Browse the repository at this point in the history
…nuxt's auto import
  • Loading branch information
CodeF53 committed Dec 23, 2023
1 parent 36c7599 commit 01cc674
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"prettier.enable": false,
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
}
}
2 changes: 1 addition & 1 deletion components/step/Processing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ async function optimizeImages() {
results = await bulkOperation(toRaw(processedImages.value), EncodeWorker, props.options.threads, iterProgress)
console.timeEnd('Encode')
}
optimizedImages.value = results
optimizedImages.value = results as DumbFile[]
// move to next step
saveResult()
Expand Down
1 change: 1 addition & 0 deletions utils/bulk/encode.worker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { encode as encodePNG } from '@jsquash/png'
import { init as initEncode } from '@jsquash/png/encode'
import { workerError } from '~/utils/misc'

// on creation, init needed shit
initEncode().then(() => {
Expand Down
1 change: 1 addition & 0 deletions utils/bulk/optimize.worker.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { init as initEncode } from '@jsquash/png/encode'
import { encode as encodePNG } from '@jsquash/png'
import optimize, { init as initOxiPNG } from '@jsquash/oxipng/optimise'
import { workerError } from '~/utils/misc'

// on creation, init needed shit
Promise.all([initOxiPNG(), initEncode()]).then(() => {
Expand Down
1 change: 1 addition & 0 deletions utils/bulk/process.worker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { initialize as initXBRZ } from '~/utils/image/xbrz'
import { processAuto } from '~/utils/image/process'
import { workerError } from '~/utils/misc'

// on creation, init needed shit
initXBRZ().then(() => {
Expand Down
1 change: 1 addition & 0 deletions utils/image/process.worker.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// for use in manual mode
import { initialize as initXBRZ } from '~/utils/image/xbrz'
import { process } from '~/utils/image/process'
import { workerError } from '~/utils/misc'

globalThis.onmessage = async (event) => {
if (event.data.init)
Expand Down

0 comments on commit 01cc674

Please sign in to comment.