Skip to content

Commit

Permalink
Merge pull request #41 from linexjlin/main
Browse files Browse the repository at this point in the history
fix for npm run build
  • Loading branch information
lxfater authored Dec 6, 2023
2 parents acae07f + 4b18969 commit 14cf037
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default function Editor(props: EditorProps) {
throw new Error('could not retrieve mask canvas')
}
// Just need the finishing touch
const line = lines.at(-1)
const line = lines.slice(-1)[0]
if (line) drawLines(ctx, [line], 'white')
}, [context?.canvas.height, context?.canvas.width, lines, maskCanvas])

Expand Down Expand Up @@ -153,7 +153,7 @@ export default function Editor(props: EditorProps) {
if (!original.src || showOriginal) {
return
}
if (lines.at(-1)?.pts.length === 0) {
if (lines.slice(-1)[0]?.pts.length === 0) {
return
}
setIsInpaintingLoading(true)
Expand All @@ -175,7 +175,7 @@ export default function Editor(props: EditorProps) {
const start = Date.now()
console.log('inpaint_start')
// each time based on the last result, the first is the original
const newFile = renders.at(-1) ?? file
const newFile = renders.slice(-1)[0] ?? file
const res = await inpaint(newFile, maskCanvas.toDataURL())
if (!res) {
throw new Error('empty response')
Expand Down

0 comments on commit 14cf037

Please sign in to comment.