's'
This commit is contained in:
11
app/page.tsx
11
app/page.tsx
@@ -84,6 +84,17 @@ export default function Home() {
|
||||
|
||||
const getOrCreateUserId = useCallback(() => {
|
||||
let userId = getStorage("userId");
|
||||
if (userId?.startsWith("{") && userId.includes("data")) {
|
||||
try {
|
||||
const parsed = JSON.parse(userId) as { data?: string };
|
||||
if (parsed?.data) {
|
||||
userId = parsed.data;
|
||||
setStorage("userId", userId);
|
||||
}
|
||||
} catch {
|
||||
userId = null;
|
||||
}
|
||||
}
|
||||
if (!userId) {
|
||||
userId = `user${Date.now()}`;
|
||||
setStorage("userId", userId);
|
||||
|
||||
Reference in New Issue
Block a user