diff --git a/src/app/features/call/CameraPreview.tsx b/src/app/features/call/CameraPreview.tsx
index 9ca8da7a..9ef670de 100644
--- a/src/app/features/call/CameraPreview.tsx
+++ b/src/app/features/call/CameraPreview.tsx
@@ -125,7 +125,7 @@ export function CameraPreview() {
gap="200"
grow="Yes"
>
-
+
{STATUS_MESSAGE[status as Exclude]}
diff --git a/src/app/hooks/useSingleSessionTab.ts b/src/app/hooks/useSingleSessionTab.ts
index ab8da517..ad794712 100644
--- a/src/app/hooks/useSingleSessionTab.ts
+++ b/src/app/hooks/useSingleSessionTab.ts
@@ -1,11 +1,12 @@
import { useEffect, useMemo } from 'react';
import { useNavigate } from 'react-router-dom';
import { getRootPath } from '../pages/pathUtils';
+import { randomStr } from '../utils/common';
export const useSingleSessionTab = (userId?: string) => {
const broadcast = useMemo(() => new BroadcastChannel('in.cinny.broadcast'), []);
- const tabId = useMemo(() => crypto.randomUUID(), []);
+ const tabId = useMemo(() => randomStr(), []);
const navigate = useNavigate();
useEffect(() => {
diff --git a/src/app/plugins/call/CallControl.ts b/src/app/plugins/call/CallControl.ts
index 211280f4..3c073af7 100644
--- a/src/app/plugins/call/CallControl.ts
+++ b/src/app/plugins/call/CallControl.ts
@@ -3,13 +3,14 @@ import { ObservableValue } from 'neurone/lib/utils/observable';
import { Disposable } from 'neurone/lib/utils/disposable';
import { CallControlState } from './CallControlState';
import { ElementMediaStateDetail, ElementMediaStatePayload, ElementWidgetActions } from './types';
+import { randomStr } from '../../utils/common';
export enum CallControlEvent {
StateUpdate = 'state_update',
}
export class CallControl implements CallControlState, Disposable {
- private readonly publishKey = crypto.randomUUID();
+ private readonly publishKey = randomStr();
public readonly state: ObservableValue;
diff --git a/src/client/MegolmBackup.ts b/src/client/MegolmBackup.ts
index 5d19c8ba..990d1e57 100644
--- a/src/client/MegolmBackup.ts
+++ b/src/client/MegolmBackup.ts
@@ -7,6 +7,7 @@ import { Base64 } from 'neurone/lib/utils';
import { Disposable, Disposer } from 'neurone/lib/utils/disposable';
import { ObservableValue } from 'neurone/lib/utils/observable';
import { ProgressCallback, responseProgress } from './responseProgress';
+import { randomStr } from '../app/utils/common';
export type ImportBackupIdle = {
type: 'idle';
@@ -43,7 +44,7 @@ export type BackupRestoreState =
export class MegolmBackup implements Disposable {
private readonly disposer = new Disposer();
- private readonly publishKey = crypto.randomUUID();
+ private readonly publishKey = randomStr();
public readonly keyBackup: ObservableValue;
diff --git a/src/client/call/CallSession.ts b/src/client/call/CallSession.ts
index 689f8677..39a20d6d 100644
--- a/src/client/call/CallSession.ts
+++ b/src/client/call/CallSession.ts
@@ -10,6 +10,7 @@ import {
getJoinRoomMemberId,
} from '../storage/collections';
import { CALL_APPLICATION_TYPE, DEFAULT_CALL_SLOT_IDS, resolveActiveRtcMembers } from './rtcMember';
+import { randomStr } from '../../app/utils/common';
export type CallMember = {
kind: 'call.member' | 'rtc.member';
@@ -71,7 +72,7 @@ export class CallSession implements Disposable {
private readonly storage: Storage;
- private readonly publisherKey = crypto.randomUUID();
+ private readonly publisherKey = randomStr();
private callEvents: JoinRoomStateObject[] = [];
diff --git a/src/client/context.ts b/src/client/context.ts
index 4dde5291..68065c69 100644
--- a/src/client/context.ts
+++ b/src/client/context.ts
@@ -32,6 +32,7 @@ import { AccountDataType } from '../types/matrix/accountData';
import { DecryptionManager } from './decryption';
import { MegolmBackup } from './MegolmBackup';
import { CallSessions } from './call';
+import { randomStr } from '../app/utils/common';
export type StateContext = {
join: {
@@ -929,7 +930,7 @@ export const createPendingMemberRoomObservable = async (
};
export const createVerificationRequestObservable = () => {
- const publishKey = crypto.randomUUID();
+ const publishKey = randomStr();
const verificationRequest = new Observable(
publishKey
);
@@ -944,7 +945,7 @@ export const createVerificationRequestObservable = () => {
};
export const createToDeviceEventsObservable = () => {
- const publishKey = crypto.randomUUID();
+ const publishKey = randomStr();
const toDeviceEvents = new Observable(publishKey);
const onToDeviceEvents = (events: ProcessedToDeviceEvent[]) => {
@@ -1036,7 +1037,7 @@ export const createBackupInfoObservable = async (
secrets: Secrets,
disposer: Disposer
): Promise> => {
- const publishKey = crypto.randomUUID();
+ const publishKey = randomStr();
const backupInfo = new ObservableValue(undefined, publishKey);
const update = async () => {
diff --git a/src/client/decryption/EncryptedEvent.ts b/src/client/decryption/EncryptedEvent.ts
index a48b6d41..42d6f160 100644
--- a/src/client/decryption/EncryptedEvent.ts
+++ b/src/client/decryption/EncryptedEvent.ts
@@ -5,6 +5,7 @@ import {
} from 'neurone/lib/api/types';
import { MegolmDecryptionError, RoomEncryption } from 'neurone/lib/crypto/machine';
import { ObservableValue } from 'neurone/lib/utils/observable';
+import { randomStr } from '../../app/utils/common';
export class EventDecryptionIdle {}
@@ -36,7 +37,7 @@ export class EventDecryptionSuccess {
export class EncryptedEvent {
private readonly roomEncryption: RoomEncryption;
- private readonly publishKey = crypto.randomUUID();
+ private readonly publishKey = randomStr();
private decryptPromise: Promise | undefined;
diff --git a/src/client/room/ThreadTimeline.ts b/src/client/room/ThreadTimeline.ts
index 3cd05844..f92f5063 100644
--- a/src/client/room/ThreadTimeline.ts
+++ b/src/client/room/ThreadTimeline.ts
@@ -23,6 +23,7 @@ import { rRelations, rThread, rUnsigned } from '../reader';
import { TimelineUtils } from './TimelineUtils';
import { LocalEventOutbox } from './local-event/LocalEventOutbox';
import { EventSenderIdle, LocalEvent, LocalEventSender, LocalMessage } from './local-event';
+import { randomStr } from '../../app/utils/common';
export type ThreadSyncData = {
events: MessageEventWithoutRoomId[];
@@ -31,7 +32,7 @@ export type ThreadSyncData = {
};
export class ThreadTimeline implements TimelineView, Disposable {
- private readonly publishKey = crypto.randomUUID();
+ private readonly publishKey = randomStr();
public readonly roomId: string;
diff --git a/src/client/room/Timeline.ts b/src/client/room/Timeline.ts
index f3f63468..ce3f9d1c 100644
--- a/src/client/room/Timeline.ts
+++ b/src/client/room/Timeline.ts
@@ -25,9 +25,10 @@ import { getThreadId } from '../../app/utils/room';
import { TimelineUtils } from './TimelineUtils';
import { EventSenderIdle, LocalEvent, LocalEventSender, LocalMessage } from './local-event';
import { LocalEventOutbox } from './local-event/LocalEventOutbox';
+import { randomStr } from '../../app/utils/common';
export class Timeline implements TimelineView, Disposable {
- private readonly publishKey = crypto.randomUUID();
+ private readonly publishKey = randomStr();
public readonly roomId: string;
diff --git a/src/client/room/TimelineBatchManager.ts b/src/client/room/TimelineBatchManager.ts
index 61a72a82..f4bb84e5 100644
--- a/src/client/room/TimelineBatchManager.ts
+++ b/src/client/room/TimelineBatchManager.ts
@@ -1,6 +1,7 @@
import { MessageEventWithoutRoomId } from 'neurone/lib/api/types';
import { ObservableValue } from 'neurone/lib/utils/observable';
import { MessageBatch, Messages, BatchInfo, BatchChange } from './messages';
+import { randomStr } from '../../app/utils/common';
export class TimelineBatchManager {
private readonly publishKey: string;
@@ -30,7 +31,7 @@ export class TimelineBatchManager {
this.batch.publish(
this.publishKey,
new MessageBatch(
- crypto.randomUUID(),
+ randomStr(),
this.batch.read.messages,
this.batch.read.prev,
new BatchInfo(undefined, false),
@@ -117,7 +118,7 @@ export class TimelineBatchManager {
public loadEvents(events: MessageEventWithoutRoomId[], prevToken?: string, nextToken?: string) {
const newBatch = new MessageBatch(
- crypto.randomUUID(),
+ randomStr(),
new Messages(events),
new BatchInfo(prevToken, !prevToken),
new BatchInfo(nextToken, !nextToken),
diff --git a/src/client/room/index.ts b/src/client/room/index.ts
index 012879e4..52857ff7 100644
--- a/src/client/room/index.ts
+++ b/src/client/room/index.ts
@@ -4,6 +4,7 @@ import { JoinRoom } from 'neurone/lib/api/matrix/client/v3/sync';
import { MatrixRequest } from 'neurone/lib/matrix-request';
import { Timeline } from './Timeline';
import { SyncValue } from '../sync';
+import { randomStr } from '../../app/utils/common';
export * from './Timeline';
export * from './TimelineView';
@@ -14,7 +15,7 @@ export const createTimelines = (
request: MatrixRequest,
disposer: Disposer
): ObservableValue