From 545088de1c69d62dd66cc97d16f5a37d3f66a56b Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Thu, 19 Oct 2023 11:57:26 -0700 Subject: [PATCH] bootstrap: simplify video clientId Signed-off-by: Varun Patil --- src/bootstrap.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bootstrap.ts b/src/bootstrap.ts index dbc48cde..1ef482ce 100644 --- a/src/bootstrap.ts +++ b/src/bootstrap.ts @@ -52,9 +52,8 @@ __webpack_public_path__ = generateFilePath('memories', '', 'js/'); // Generate client id for this instance // Does not need to be cryptographically secure -const getClientId = (): string => Math.random().toString(36).substring(2, 15).padEnd(12, '0'); -_m.video.clientId = getClientId(); -_m.video.clientIdPersistent = localStorage.getItem('videoClientIdPersistent') ?? getClientId(); +_m.video.clientId = Math.random().toString(36).substring(2, 15).padEnd(12, '0'); +_m.video.clientIdPersistent = localStorage.getItem('videoClientIdPersistent') ?? _m.video.clientId; localStorage.setItem('videoClientIdPersistent', _m.video.clientIdPersistent); // Turn on virtual keyboard support