Julian Bilcke
commited on
Commit
Β·
9ee3c2f
1
Parent(s):
421fbba
fixed file name generation
Browse files
src/app/interface/bottom-bar/bottom-bar.tsx
CHANGED
|
@@ -184,7 +184,7 @@ function BottomBar() {
|
|
| 184 |
>Load</Button> : null}
|
| 185 |
{canSeeBetaFeatures ? <Button
|
| 186 |
onClick={downloadClap}
|
| 187 |
-
disabled={
|
| 188 |
>
|
| 189 |
{remainingImages ? `${allStatus.length - remainingImages}/${allStatus.length} β` : `Save`}
|
| 190 |
</Button> : null}
|
|
|
|
| 184 |
>Load</Button> : null}
|
| 185 |
{canSeeBetaFeatures ? <Button
|
| 186 |
onClick={downloadClap}
|
| 187 |
+
disabled={remainingImages > 0}
|
| 188 |
>
|
| 189 |
{remainingImages ? `${allStatus.length - remainingImages}/${allStatus.length} β` : `Save`}
|
| 190 |
</Button> : null}
|
src/app/store/index.ts
CHANGED
|
@@ -638,9 +638,12 @@ export const useStore = create<{
|
|
| 638 |
|
| 639 |
const [stylePrompt, storyPrompt] = prompt.split("||").map(x => x.trim())
|
| 640 |
|
| 641 |
-
const cleanStylePrompt = stylePrompt.replace(/([a-z0-
|
| 642 |
-
|
| 643 |
-
const
|
|
|
|
|
|
|
|
|
|
| 644 |
|
| 645 |
anchor.download = `${cleanName}.clap`
|
| 646 |
|
|
|
|
| 638 |
|
| 639 |
const [stylePrompt, storyPrompt] = prompt.split("||").map(x => x.trim())
|
| 640 |
|
| 641 |
+
const cleanStylePrompt = stylePrompt.replace(/([^a-z0-9, ]+)/gi, "_")
|
| 642 |
+
|
| 643 |
+
const firstPartOfStory = storyPrompt.split(",").shift() || ""
|
| 644 |
+
const cleanStoryPrompt = firstPartOfStory.replace(/([^a-z0-9, ]+)/gi, "_")
|
| 645 |
+
|
| 646 |
+
const cleanName = `${cleanStoryPrompt.slice(0, 22)} (${cleanStylePrompt.slice(0, 22) || "default style"})`
|
| 647 |
|
| 648 |
anchor.download = `${cleanName}.clap`
|
| 649 |
|