diff --git a/app/components/mj/mask-editor/utils.ts b/app/components/mj/mask-editor/utils.ts index 3120aca7..d3060a37 100644 --- a/app/components/mj/mask-editor/utils.ts +++ b/app/components/mj/mask-editor/utils.ts @@ -10,7 +10,7 @@ export const toMask = (canvas: HTMLCanvasElement) => { if (imageData) { for (var i = 0; i < imageData?.data.length; i += 4) { const pixelColor = - imageData.data[i] === 255 ? [255, 255, 255] : [0, 0, 0]; + imageData.data[i] === 255 ? [0, 0, 0] : [255, 255, 255]; imageData.data[i] = pixelColor[0]; imageData.data[i + 1] = pixelColor[1]; imageData.data[i + 2] = pixelColor[2]; diff --git a/app/components/mj/mj.tsx b/app/components/mj/mj.tsx index 0e1db4b3..9ecb8f0a 100644 --- a/app/components/mj/mj.tsx +++ b/app/components/mj/mj.tsx @@ -32,6 +32,7 @@ import { showConfirm, showImageModal, showModal, + showToast, } from "@/app/components/ui-lib"; import { removeImage } from "@/app/utils/chat"; import { SideBar } from "./mj-sidebar"; @@ -366,6 +367,15 @@ export function Mj() { .SubmitRegion } onClick={() => { + if (!inputText) { + showToast( + Locales.MjPanel.ParamIsRequired( + Locales.MjPanel + .Prompt, + ), + ); + return; + } mjStore.sendTask( { action: "action", @@ -419,7 +429,9 @@ export function Mj() { width: "100%", }} type="text" - placeholder="Prompt" + placeholder={ + Locales.MjPanel.Prompt + } className={ styles[ "user-prompt-search" diff --git a/app/store/mj.ts b/app/store/mj.ts index 4908cd31..8a4ebd47 100644 --- a/app/store/mj.ts +++ b/app/store/mj.ts @@ -159,7 +159,6 @@ export const useMjStore = createPersistStore< }); call && call(null); if (!opt?.dontFetchStatus) { - console.log("fetch status", opt); this.intervalFetchStatus(id, taskId, opt); } } else {