mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 08:37:22 +00:00
Re-use local storage prompt on index until project has been created.
This commit is contained in:
1 parent
213eda9797
commit
00a24f13b6
1 file changed
+6
-1
+6
-1
@@ -64,7 +64,12 @@ export default function Index() {
|
|||||||
loadProjects();
|
loadProjects();
|
||||||
}, [loadProjects]);
|
}, [loadProjects]);
|
||||||
|
|
||||||
|
// Restore prompt from local storage on mount
|
||||||
|
useEffect(() => {
|
||||||
|
if (storedPrompt) {
|
||||||
|
setPrompt(storedPrompt);
|
||||||
|
}
|
||||||
|
}, [storedPrompt]);
|
||||||
|
|
||||||
// Sync prompt with local storage
|
// Sync prompt with local storage
|
||||||
const handlePromptChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
const handlePromptChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
||||||
|
|||||||
Reference in new issue
Block a user