Update the Imaginate image generation API (#836)

* Update the Imaginate feature server API

* Change connection status strategy to prevent console errors

* Possible CORS fix? Maybe revert.

* Update to the final API and fix bugs
This commit is contained in:
Keavon Chambers
2022-11-02 17:20:29 -07:00
parent 9d56e86203
commit 5be59f7fce
3 changed files with 121 additions and 227 deletions

View File

@@ -584,12 +584,14 @@ export default defineComponent({
},
async activateEyedropperSample() {
// TODO: Replace this temporary solution that only works in Chromium-based browsers with the custom color sampler used by the Eyedropper tool
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if (!(window as any).EyeDropper) {
this.editor.instance.eyedropperSampleForColorPicker();
return;
}
try {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const result = await new (window as any).EyeDropper().open();
this.setColorCode(result.sRGBHex);
} catch {