Compare commits
2 Commits
main
...
5d9b2ca2d0
| Author | SHA1 | Date | |
|---|---|---|---|
| 5d9b2ca2d0 | |||
| 7f6e33242c |
@@ -47,27 +47,9 @@ const AGENTS = {
|
|||||||
export default function Playground() {
|
export default function Playground() {
|
||||||
const [isScriptRunning, setIsScriptRunning] = useState(false);
|
const [isScriptRunning, setIsScriptRunning] = useState(false);
|
||||||
const [isEditorReady, setIsEditorReady] = useState(false);
|
const [isEditorReady, setIsEditorReady] = useState(false);
|
||||||
const [fontSize, setFontSize] = useState(() => {
|
const [fontSize, setFontSize] = useState(14);
|
||||||
if (typeof window !== "undefined") {
|
const [bulkRounds, setBulkRounds] = useState(1000);
|
||||||
const saved = localStorage.getItem("playground-fontSize");
|
const [selectedAgent, setSelectedAgent] = useState("Self");
|
||||||
return saved ? parseInt(saved, 10) : 14;
|
|
||||||
}
|
|
||||||
return 14;
|
|
||||||
});
|
|
||||||
const [bulkRounds, setBulkRounds] = useState(() => {
|
|
||||||
if (typeof window !== "undefined") {
|
|
||||||
const saved = localStorage.getItem("playground-bulkRounds");
|
|
||||||
return saved ? parseInt(saved, 10) : 1000;
|
|
||||||
}
|
|
||||||
return 1000;
|
|
||||||
});
|
|
||||||
const [selectedAgent, setSelectedAgent] = useState(() => {
|
|
||||||
if (typeof window !== "undefined") {
|
|
||||||
const saved = localStorage.getItem("playground-selectedAgent");
|
|
||||||
return saved || "Self";
|
|
||||||
}
|
|
||||||
return "Self";
|
|
||||||
});
|
|
||||||
const [isHelpOpen, setIsHelpOpen] = useState(false);
|
const [isHelpOpen, setIsHelpOpen] = useState(false);
|
||||||
const [scriptName, setScriptName] = useState("");
|
const [scriptName, setScriptName] = useState("");
|
||||||
const [saveSecret, setSaveSecret] = useState("");
|
const [saveSecret, setSaveSecret] = useState("");
|
||||||
@@ -140,30 +122,6 @@ export default function Playground() {
|
|||||||
loadSavedScripts();
|
loadSavedScripts();
|
||||||
}, [loadSavedScripts]);
|
}, [loadSavedScripts]);
|
||||||
|
|
||||||
// Save font size to localStorage
|
|
||||||
useEffect(() => {
|
|
||||||
if (typeof window !== "undefined") {
|
|
||||||
localStorage.setItem("playground-fontSize", fontSize.toString());
|
|
||||||
}
|
|
||||||
}, [fontSize]);
|
|
||||||
|
|
||||||
// Save bulk rounds to localStorage
|
|
||||||
useEffect(() => {
|
|
||||||
if (typeof window !== "undefined") {
|
|
||||||
localStorage.setItem(
|
|
||||||
"playground-bulkRounds",
|
|
||||||
bulkRounds.toString()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}, [bulkRounds]);
|
|
||||||
|
|
||||||
// Save selected agent to localStorage
|
|
||||||
useEffect(() => {
|
|
||||||
if (typeof window !== "undefined") {
|
|
||||||
localStorage.setItem("playground-selectedAgent", selectedAgent);
|
|
||||||
}
|
|
||||||
}, [selectedAgent]);
|
|
||||||
|
|
||||||
const runHuman = useCallback(async () => {
|
const runHuman = useCallback(async () => {
|
||||||
if (resultRef.current) {
|
if (resultRef.current) {
|
||||||
resultRef.current.value = "";
|
resultRef.current.value = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user