Update share_btn.py
Browse files- share_btn.py +3 -3
share_btn.py
CHANGED
@@ -28,10 +28,10 @@ share_js = """async () => {
|
|
28 |
const imgId = Date.now() % 200;
|
29 |
const isPng = imgEl.src.startsWith(`data:image/png`);
|
30 |
if(isPng){
|
31 |
-
const fileName = `
|
32 |
return new File([blob], fileName, { type: 'image/png' });
|
33 |
}else{
|
34 |
-
const fileName = `
|
35 |
return new File([blob], fileName, { type: 'image/jpeg' });
|
36 |
}
|
37 |
}
|
@@ -81,7 +81,7 @@ ${htmlImgsMd}
|
|
81 |
description: descriptionMd,
|
82 |
});
|
83 |
const paramsStr = params.toString();
|
84 |
-
window.open(`https://huggingface.co/spaces/
|
85 |
shareBtnEl.style.removeProperty('pointer-events');
|
86 |
shareIconEl.style.removeProperty('display');
|
87 |
loadingIconEl.style.display = 'none';
|
|
|
28 |
const imgId = Date.now() % 200;
|
29 |
const isPng = imgEl.src.startsWith(`data:image/png`);
|
30 |
if(isPng){
|
31 |
+
const fileName = `magic-prompt-${{imgId}}.png`;
|
32 |
return new File([blob], fileName, { type: 'image/png' });
|
33 |
}else{
|
34 |
+
const fileName = `magic-prompt-${{imgId}}.jpg`;
|
35 |
return new File([blob], fileName, { type: 'image/jpeg' });
|
36 |
}
|
37 |
}
|
|
|
81 |
description: descriptionMd,
|
82 |
});
|
83 |
const paramsStr = params.toString();
|
84 |
+
window.open(`https://huggingface.co/spaces/huggingface-projects/magic-prompt/new?${paramsStr}`, '_blank');
|
85 |
shareBtnEl.style.removeProperty('pointer-events');
|
86 |
shareIconEl.style.removeProperty('display');
|
87 |
loadingIconEl.style.display = 'none';
|