Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/scripts/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function Create() {

const handleSubmit = async () => {
const defaultName = "New Assistant";
const slug = defaultName.toLowerCase().replace(" ", "-") + "-" + Math.random().toString(36).substring(2, 7);
const slug = defaultName.toLowerCase().replaceAll(" ", "-") + "-" + Math.random().toString(36).substring(2, 7);
createScript({
displayName: defaultName,
slug,
Expand Down
2 changes: 1 addition & 1 deletion contexts/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const EditContextProvider: React.FC<EditContextProps> = ({scriptPath, children})
// Only update slug when displayName has changed
if (existing?.displayName !== root.name) {
toUpdate.displayName = root.name;
toUpdate.slug = toUpdate.displayName?.toLowerCase().replace(" ", "-") + "-" + Math.random().toString(36).substring(2, 7);
toUpdate.slug = toUpdate.displayName?.toLowerCase().replaceAll(" ", "-") + "-" + Math.random().toString(36).substring(2, 7);
} else {
toUpdate.slug = existing?.slug;
}
Expand Down