Skip to content

Commit eb34d12

Browse files
authored
[ty] Reject renaming files to start with slash in Playground (#20666)
1 parent 56d630e commit eb34d12

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

playground/ty/src/Playground.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ export default function Playground() {
9696
file: FileId,
9797
newName: string,
9898
) => {
99+
if (newName.startsWith("/")) {
100+
setError("File names cannot start with '/'.");
101+
return;
102+
}
103+
99104
const handle = files.handles[file];
100105
let newHandle: FileHandle | null = null;
101106
if (handle == null) {

0 commit comments

Comments
 (0)