localStorage follow
All checks were successful
Build static content / build (push) Successful in 3m8s
All checks were successful
Build static content / build (push) Successful in 3m8s
This commit is contained in:
@@ -56,9 +56,19 @@ export default function ChatBOX(props: {
|
||||
const [showAddToolMsg, setShowAddToolMsg] = useState(false);
|
||||
const [newToolCallID, setNewToolCallID] = useState("");
|
||||
const [newToolContent, setNewToolContent] = useState("");
|
||||
const [follow, setFollow] = useState(true);
|
||||
let default_follow = localStorage.getItem("follow");
|
||||
if (default_follow === null) {
|
||||
default_follow = "true";
|
||||
}
|
||||
const [follow, _setFollow] = useState(default_follow === "true");
|
||||
const mediaRef = createRef();
|
||||
|
||||
const setFollow = (follow: boolean) => {
|
||||
console.log("set follow", follow);
|
||||
localStorage.setItem("follow", follow.toString());
|
||||
_setFollow(follow);
|
||||
};
|
||||
|
||||
const messagesEndRef = createRef();
|
||||
useEffect(() => {
|
||||
if (follow) {
|
||||
|
||||
Reference in New Issue
Block a user