mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Providing fileName string directly to DataViewer as suggested
This commit is contained in:
parent
37b1f21bcf
commit
9cba0dfac9
@ -32,9 +32,8 @@ const DataViewer = (props: Props) => {
|
||||
const handleDownload = useCallback(() => {
|
||||
const blob = new Blob([dataString]);
|
||||
const a = document.createElement('a');
|
||||
const imageName = fileName ? fileName.replace('.png', '') : null;
|
||||
a.href = URL.createObjectURL(blob);
|
||||
a.download = imageName ? `${ imageName }_${ label }.json` : `${ label }.json`;
|
||||
a.download = `${ fileName || label }.json`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
|
@ -28,7 +28,7 @@ const ImageMetadataGraphTabContent = ({ image }: Props) => {
|
||||
return <IAINoContentFallback label={t('nodes.noGraph')} />;
|
||||
}
|
||||
|
||||
return <DataViewer fileName={image.image_name} data={graph} label={t('nodes.graph')} />;
|
||||
return <DataViewer fileName={`${image.image_name.replace('.png','')}_${t('nodes.graph')}`} data={graph} label={t('nodes.graph')} />;
|
||||
};
|
||||
|
||||
export default memo(ImageMetadataGraphTabContent);
|
||||
|
@ -68,14 +68,14 @@ const ImageMetadataViewer = ({ image }: ImageMetadataViewerProps) => {
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
{metadata ? (
|
||||
<DataViewer fileName={image.image_name} data={metadata} label={t('metadata.metadata')} />
|
||||
<DataViewer fileName={`${image.image_name.replace('.png','')}_${t('metadata.metadata')}`} data={metadata} label={t('metadata.metadata')} />
|
||||
) : (
|
||||
<IAINoContentFallback label={t('metadata.noMetaData')} />
|
||||
)}
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
{image ? (
|
||||
<DataViewer fileName={image.image_name} data={image} label={t('metadata.imageDetails')} />
|
||||
<DataViewer fileName={`${image.image_name.replace('.png','')}_${t('metadata.imageDetails')}`} data={image} label={t('metadata.imageDetails')} />
|
||||
) : (
|
||||
<IAINoContentFallback label={t('metadata.noImageDetails')} />
|
||||
)}
|
||||
|
@ -28,7 +28,7 @@ const ImageMetadataWorkflowTabContent = ({ image }: Props) => {
|
||||
return <IAINoContentFallback label={t('nodes.noWorkflow')} />;
|
||||
}
|
||||
|
||||
return <DataViewer fileName={image.image_name} data={workflow} label={t('metadata.workflow')} />;
|
||||
return <DataViewer fileName={`${image.image_name.replace('.png','')}_${t('metadata.workflow')}`} data={workflow} label={t('metadata.workflow')} />;
|
||||
};
|
||||
|
||||
export default memo(ImageMetadataWorkflowTabContent);
|
||||
|
Loading…
Reference in New Issue
Block a user