Skip to content

Commit

Permalink
Resolve error
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaynegi45 committed Nov 21, 2024
1 parent 1e2903d commit a5aed9b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 33 deletions.
5 changes: 1 addition & 4 deletions src/app/api/auth/verify-otp/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import { auth } from "@/auth";
import { eq } from "drizzle-orm";

// In-memory store for rate limiting
const rateLimit = new Map<
string,
{ requests: number; lastRequestTime: number }
>();
const rateLimit = new Map < string, { requests: number; lastRequestTime: number } >();

// Rate limiting configuration
const MAX_REQUESTS = 3; // Max requests per window
Expand Down
58 changes: 29 additions & 29 deletions src/components/Screen.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
"use client";

import { useState, useEffect } from 'react';

const ScreenWidth: React.FC = () => {
const [screenWidth, setScreenWidth] = useState<number>(0);

useEffect(() => {
// Function to update the screen width
const updateWidth = () => setScreenWidth(window.innerWidth);

// Set the initial width
updateWidth();

// Add event listener to track window resize
window.addEventListener('resize', updateWidth);

// Cleanup event listener on component unmount
return () => window.removeEventListener('resize', updateWidth);
}, []);

return (
<div>
<h1>Screen Width: {screenWidth}px</h1>
</div>
);
};

export default ScreenWidth;
// "use client";
//
// import { useState, useEffect } from 'react';
//
// const ScreenWidth: React.FC = () => {
// const [screenWidth, setScreenWidth] = useState<number>(0);
//
// useEffect(() => {
// // Function to update the screen width
// const updateWidth = () => setScreenWidth(window.innerWidth);
//
// // Set the initial width
// updateWidth();
//
// // Add event listener to track window resize
// window.addEventListener('resize', updateWidth);
//
// // Cleanup event listener on component unmount
// return () => window.removeEventListener('resize', updateWidth);
// }, []);
//
// return (
// <div>
// <h1>Screen Width: {screenWidth}px</h1>
// </div>
// );
// };
//
// export default ScreenWidth;

0 comments on commit a5aed9b

Please sign in to comment.