Spaces:
Running
Running
projectName shorter
Browse files- hooks/useAi.ts +1 -1
hooks/useAi.ts
CHANGED
|
@@ -223,7 +223,7 @@ export const useAi = (onScrollToBottom?: () => void) => {
|
|
| 223 |
const newPages = formatPages(contentResponse, false);
|
| 224 |
let projectName = contentResponse.match(/<<<<<<< PROJECT_NAME_START\s*([\s\S]*?)\s*>>>>>>> PROJECT_NAME_END/)?.[1]?.trim();
|
| 225 |
if (!projectName) {
|
| 226 |
-
projectName = prompt.substring(0,
|
| 227 |
}
|
| 228 |
setPages(newPages);
|
| 229 |
setLastSavedPages([...newPages]);
|
|
|
|
| 223 |
const newPages = formatPages(contentResponse, false);
|
| 224 |
let projectName = contentResponse.match(/<<<<<<< PROJECT_NAME_START\s*([\s\S]*?)\s*>>>>>>> PROJECT_NAME_END/)?.[1]?.trim();
|
| 225 |
if (!projectName) {
|
| 226 |
+
projectName = prompt.substring(0, 20).replace(/[^a-zA-Z0-9]/g, "-") + "-" + Math.random().toString(36).substring(2, 9);
|
| 227 |
}
|
| 228 |
setPages(newPages);
|
| 229 |
setLastSavedPages([...newPages]);
|