Skip to content

Commit

Permalink
feat(gui): navigate to appropriate tab when copying image (fixes #80)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Feb 5, 2023
1 parent e6e9914 commit 1e477f7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gui/src/components/ImageCard.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { doesExist, mustExist } from '@apextoaster/js-utils';
import { Brush, ContentCopy, ContentCopyTwoTone, Delete, Download } from '@mui/icons-material';
import { Box, Button, Card, CardContent, CardMedia, Grid, IconButton, Paper, Tooltip } from '@mui/material';
import { Brush, ContentCopy, Delete, Download } from '@mui/icons-material';
import { Box, Card, CardContent, CardMedia, Grid, IconButton, Paper, Tooltip } from '@mui/material';
import * as React from 'react';
import { useContext } from 'react';
import { useHash } from 'react-use/lib/useHash';
import { useStore } from 'zustand';

import { ImageResponse } from '../client.js';
Expand All @@ -24,6 +25,7 @@ export function ImageCard(props: ImageCardProps) {
const { value } = props;
const { params, output, size } = value;

const [_hash, setHash] = useHash();
const config = mustExist(useContext(ConfigContext));
const state = mustExist(useContext(StateContext));
// eslint-disable-next-line @typescript-eslint/unbound-method
Expand All @@ -41,13 +43,15 @@ export function ImageCard(props: ImageCardProps) {
setImg2Img({
source: blob,
});
setHash('img2img');
}

async function copySourceToInpaint() {
const blob = await loadSource();
setInpaint({
source: blob,
});
setHash('inpaint');
}

function deleteImage() {
Expand Down

0 comments on commit 1e477f7

Please sign in to comment.