Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Pressing enter key will call fetchdata

atyabbinb7d3e5439a68
diff --git a/infra/staff/src/App.tsx b/infra/staff/src/App.tsx
index e03b8c5bf1..e27c24ccbf 100644
--- a/infra/staff/src/App.tsx
+++ b/infra/staff/src/App.tsx
@@ -155,10 +155,19 @@ export const App: React.FC = () => {
return rows;
};
+ const handleKeyPress = (event: React.KeyboardEvent<HTMLFormElement>) => {
+ if (event.key === "Enter") {
+ event.preventDefault(); // Prevent form submission
+ fetchData().catch((error: unknown) =>
+ console.error("Fetch data error:", error),
+ );
+ }
+ };
+
return (
<div className="container center-table">
<h1>{S.hello}</h1>
- <form className="input-form">
+ <form className="input-form" onKeyPress={handleKeyPress}>
<div className="input-group">
<label>
Token: