forked from Tadrisino/MathApp_frontend
Login: no guest option; every user signs in with a phone number
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -24,21 +24,8 @@ export const store = {
|
||||
};
|
||||
|
||||
export const KEYS = {
|
||||
deviceId: 'deviceId',
|
||||
onboarded: 'tadrisino.onboarded',
|
||||
conversationId: 'tadrisino.conversationId',
|
||||
sound: 'tadrisino.sound',
|
||||
referralCode: 'tadrisino.referralCode',
|
||||
} as const;
|
||||
|
||||
/** شناسهی ثابتِ این مرورگر برای ورودِ مهمان. */
|
||||
export function getDeviceId(): string {
|
||||
let id = store.get(KEYS.deviceId);
|
||||
if (!id) {
|
||||
id = globalThis.crypto && 'randomUUID' in crypto
|
||||
? crypto.randomUUID()
|
||||
: `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
||||
store.set(KEYS.deviceId, id);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user