import uuid from 'react-native-uuid' import {device} from '#/storage' /** * A locally-generated, locally-stored device identifier. This never leaves the * device — it is only used to disambiguate which device created a synced draft * (see `#/view/com/composer/drafts`) and to surface in the About screen for * debugging. It is not sent to any analytics or telemetry service. */ export async function ensureDeviceId() { const existing = getDeviceId() if (existing) return existing const id = uuid.v4() device.set(['deviceId'], id) return id } export function getDeviceId() { return device.get(['deviceId']) }