);
- }
+ },
);
interface TooltipTriggerProps {
@@ -69,7 +69,7 @@ interface TooltipTriggerProps {
export const TooltipTrigger = forwardRef(
(
{ children, placement, tooltip, ...rest }: TooltipTriggerProps,
- ref: ForwardedRef
+ ref: ForwardedRef,
) => {
const tooltipTriggerProps = { delay: 250, ...rest };
const tooltipState = useTooltipTriggerState(tooltipTriggerProps);
@@ -78,7 +78,7 @@ export const TooltipTrigger = forwardRef(
const { triggerProps, tooltipProps } = useTooltipTrigger(
tooltipTriggerProps,
tooltipState,
- triggerRef
+ triggerRef,
);
const { overlayProps } = useOverlayPosition({
@@ -94,7 +94,7 @@ export const TooltipTrigger = forwardRef(
(
children.props,
- rest
+ rest,
)}
/>
{tooltipState.isOpen && (
@@ -110,5 +110,5 @@ export const TooltipTrigger = forwardRef(
)}
);
- }
+ },
);
diff --git a/src/TranslatedError.ts b/src/TranslatedError.ts
index 595672cc..6c7f5dad 100644
--- a/src/TranslatedError.ts
+++ b/src/TranslatedError.ts
@@ -39,5 +39,5 @@ class TranslatedErrorImpl extends TranslatedError {}
// function instead
export const translatedError = (
messageKey: string,
- t: typeof i18n.t
+ t: typeof i18n.t,
): TranslatedError => new TranslatedErrorImpl(messageKey, t);
diff --git a/src/UrlParams.ts b/src/UrlParams.ts
index be334fd7..498d7cc5 100644
--- a/src/UrlParams.ts
+++ b/src/UrlParams.ts
@@ -119,17 +119,17 @@ interface UrlParams {
// file.
export function editFragmentQuery(
hash: string,
- edit: (params: URLSearchParams) => URLSearchParams
+ edit: (params: URLSearchParams) => URLSearchParams,
): string {
const fragmentQueryStart = hash.indexOf("?");
const fragmentParams = edit(
new URLSearchParams(
- fragmentQueryStart === -1 ? "" : hash.substring(fragmentQueryStart)
- )
+ fragmentQueryStart === -1 ? "" : hash.substring(fragmentQueryStart),
+ ),
);
return `${hash.substring(
0,
- fragmentQueryStart
+ fragmentQueryStart,
)}?${fragmentParams.toString()}`;
}
@@ -142,7 +142,7 @@ class ParamParser {
const fragmentQueryStart = hash.indexOf("?");
this.fragmentParams = new URLSearchParams(
- fragmentQueryStart === -1 ? "" : hash.substring(fragmentQueryStart)
+ fragmentQueryStart === -1 ? "" : hash.substring(fragmentQueryStart),
);
}
@@ -174,7 +174,7 @@ class ParamParser {
*/
export const getUrlParams = (
search = window.location.search,
- hash = window.location.hash
+ hash = window.location.hash,
): UrlParams => {
const parser = new ParamParser(search, hash);
@@ -221,7 +221,7 @@ export const useUrlParams = (): UrlParams => {
export function getRoomIdentifierFromUrl(
pathname: string,
search: string,
- hash: string
+ hash: string,
): RoomIdentifier {
let roomAlias: string | null = null;
pathname = pathname.substring(1); // Strip the "/"
@@ -281,6 +281,6 @@ export const useRoomIdentifier = (): RoomIdentifier => {
const { pathname, search, hash } = useLocation();
return useMemo(
() => getRoomIdentifierFromUrl(pathname, search, hash),
- [pathname, search, hash]
+ [pathname, search, hash],
);
};
diff --git a/src/UserMenuContainer.tsx b/src/UserMenuContainer.tsx
index c629ecea..c0155dcb 100644
--- a/src/UserMenuContainer.tsx
+++ b/src/UserMenuContainer.tsx
@@ -34,7 +34,7 @@ export const UserMenuContainer: FC = ({ preventNavigation = false }) => {
const [settingsModalOpen, setSettingsModalOpen] = useState(false);
const onDismissSettingsModal = useCallback(
() => setSettingsModalOpen(false),
- [setSettingsModalOpen]
+ [setSettingsModalOpen],
);
const [defaultSettingsTab, setDefaultSettingsTab] = useState();
@@ -58,7 +58,7 @@ export const UserMenuContainer: FC = ({ preventNavigation = false }) => {
break;
}
},
- [history, location, logout, setSettingsModalOpen]
+ [history, location, logout, setSettingsModalOpen],
);
const userName = client?.getUserIdLocalpart() ?? "";
diff --git a/src/analytics/PosthogAnalytics.ts b/src/analytics/PosthogAnalytics.ts
index a0316736..c1778f8b 100644
--- a/src/analytics/PosthogAnalytics.ts
+++ b/src/analytics/PosthogAnalytics.ts
@@ -146,7 +146,7 @@ export class PosthogAnalytics {
this.enabled = true;
} else {
logger.info(
- "Posthog is not enabled because there is no api key or no host given in the config"
+ "Posthog is not enabled because there is no api key or no host given in the config",
);
this.enabled = false;
}
@@ -157,7 +157,7 @@ export class PosthogAnalytics {
private sanitizeProperties = (
properties: Properties,
- _eventName: string
+ _eventName: string,
): Properties => {
// Callback from posthog to sanitize properties before sending them to the server.
// Here we sanitize posthog's built in properties which leak PII e.g. url reporting.
@@ -201,7 +201,7 @@ export class PosthogAnalytics {
private capture(
eventName: string,
properties: Properties,
- options?: CaptureOptions
+ options?: CaptureOptions,
): void {
if (!this.enabled) {
return;
@@ -237,7 +237,7 @@ export class PosthogAnalytics {
}
private async identifyUser(
- analyticsIdGenerator: () => string
+ analyticsIdGenerator: () => string,
): Promise {
if (this.anonymity == Anonymity.Pseudonymous && this.enabled) {
// Check the user's account_data for an analytics ID to use. Storing the ID in account_data allows
@@ -260,14 +260,14 @@ export class PosthogAnalytics {
// The above could fail due to network requests, but not essential to starting the application,
// so swallow it.
logger.log(
- "Unable to identify user for tracking" + (e as Error)?.toString()
+ "Unable to identify user for tracking" + (e as Error)?.toString(),
);
}
if (analyticsID) {
this.posthog.identify(analyticsID);
} else {
logger.info(
- "No analyticsID is availble. Should not try to setup posthog"
+ "No analyticsID is availble. Should not try to setup posthog",
);
}
}
@@ -280,7 +280,7 @@ export class PosthogAnalytics {
accountAnalyticsId = getUrlParams().analyticsID;
} else {
const accountData = await client.getAccountDataFromServer(
- PosthogAnalytics.ANALYTICS_EVENT_TYPE
+ PosthogAnalytics.ANALYTICS_EVENT_TYPE,
);
accountAnalyticsId = accountData?.id;
}
@@ -294,13 +294,13 @@ export class PosthogAnalytics {
}
private async hashedEcAnalyticsId(
- accountAnalyticsId: string
+ accountAnalyticsId: string,
): Promise {
const client: MatrixClient = window.matrixclient;
const posthogIdMaterial = "ec" + accountAnalyticsId + client.getUserId();
const bufferForPosthogId = await crypto.subtle.digest(
"sha-256",
- Buffer.from(posthogIdMaterial, "utf-8")
+ Buffer.from(posthogIdMaterial, "utf-8"),
);
const view = new Int32Array(bufferForPosthogId);
return Array.from(view)
@@ -314,11 +314,11 @@ export class PosthogAnalytics {
// the analytics ID only needs to be set in the standalone version.
const accountData = await client.getAccountDataFromServer(
- PosthogAnalytics.ANALYTICS_EVENT_TYPE
+ PosthogAnalytics.ANALYTICS_EVENT_TYPE,
);
await client.setAccountData(
PosthogAnalytics.ANALYTICS_EVENT_TYPE,
- Object.assign({ id: analyticsID }, accountData)
+ Object.assign({ id: analyticsID }, accountData),
);
}
}
@@ -360,7 +360,7 @@ export class PosthogAnalytics {
}
private async updateAnonymityAndIdentifyUser(
- pseudonymousOptIn: boolean
+ pseudonymousOptIn: boolean,
): Promise {
// Update this.anonymity based on the user's analytics opt-in settings
const anonymity = pseudonymousOptIn
@@ -376,11 +376,11 @@ export class PosthogAnalytics {
this.setRegistrationType(
window.matrixclient.isGuest() || window.passwordlessUser
? RegistrationType.Guest
- : RegistrationType.Registered
+ : RegistrationType.Registered,
);
// store the promise to await posthog-tracking-events until the identification is done.
this.identificationPromise = this.identifyUser(
- PosthogAnalytics.getRandomAnalyticsId
+ PosthogAnalytics.getRandomAnalyticsId,
);
await this.identificationPromise;
if (this.userRegisteredInThisSession()) {
@@ -395,7 +395,7 @@ export class PosthogAnalytics {
public async trackEvent(
{ eventName, ...properties }: E,
- options?: CaptureOptions
+ options?: CaptureOptions,
): Promise {
if (this.identificationPromise) {
// only make calls to posthog after the identificaion is done
diff --git a/src/analytics/PosthogEvents.ts b/src/analytics/PosthogEvents.ts
index 89c1ee50..c200f74b 100644
--- a/src/analytics/PosthogEvents.ts
+++ b/src/analytics/PosthogEvents.ts
@@ -43,14 +43,14 @@ export class CallEndedTracker {
public cacheParticipantCountChanged(count: number): void {
this.cache.maxParticipantsCount = Math.max(
count,
- this.cache.maxParticipantsCount
+ this.cache.maxParticipantsCount,
);
}
public track(
callId: string,
callParticipantsNow: number,
- sendInstantly: boolean
+ sendInstantly: boolean,
): void {
PosthogAnalytics.instance.trackEvent(
{
@@ -60,7 +60,7 @@ export class CallEndedTracker {
callParticipantsOnLeave: callParticipantsNow,
callDuration: (Date.now() - this.cache.startTime.getTime()) / 1000,
},
- { send_instantly: sendInstantly }
+ { send_instantly: sendInstantly },
);
}
}
diff --git a/src/analytics/PosthogSpanProcessor.ts b/src/analytics/PosthogSpanProcessor.ts
index 98a6dbbc..8904b3e1 100644
--- a/src/analytics/PosthogSpanProcessor.ts
+++ b/src/analytics/PosthogSpanProcessor.ts
@@ -148,7 +148,7 @@ export class PosthogSpanProcessor implements SpanProcessor {
ratioPeerConnectionToDevices: ratioPeerConnectionToDevices,
},
// Send instantly because the window might be closing
- { send_instantly: true }
+ { send_instantly: true },
);
}
}
diff --git a/src/analytics/RageshakeSpanProcessor.ts b/src/analytics/RageshakeSpanProcessor.ts
index 670a77c3..91d0e190 100644
--- a/src/analytics/RageshakeSpanProcessor.ts
+++ b/src/analytics/RageshakeSpanProcessor.ts
@@ -23,7 +23,7 @@ import {
} from "@opentelemetry/sdk-trace-base";
const dumpAttributes = (
- attr: Attributes
+ attr: Attributes,
): {
key: string;
type:
diff --git a/src/array-utils.ts b/src/array-utils.ts
index 6aeb1818..0bb0270d 100644
--- a/src/array-utils.ts
+++ b/src/array-utils.ts
@@ -22,7 +22,7 @@ limitations under the License.
// Array.prototype.findLastIndex
export function findLastIndex(
array: T[],
- predicate: (item: T, index: number) => boolean
+ predicate: (item: T, index: number) => boolean,
): number | null {
for (let i = array.length - 1; i >= 0; i--) {
if (predicate(array[i], i)) return i;
@@ -36,9 +36,9 @@ export function findLastIndex(
*/
export const count = (
array: T[],
- predicate: (item: T, index: number) => boolean
+ predicate: (item: T, index: number) => boolean,
): number =>
array.reduce(
(acc, item, index) => (predicate(item, index) ? acc + 1 : acc),
- 0
+ 0,
);
diff --git a/src/auth/LoginPage.tsx b/src/auth/LoginPage.tsx
index 6569f262..d414a2bc 100644
--- a/src/auth/LoginPage.tsx
+++ b/src/auth/LoginPage.tsx
@@ -80,7 +80,7 @@ export const LoginPage: FC = () => {
setLoading(false);
});
},
- [login, location, history, homeserver, setClient]
+ [login, location, history, homeserver, setClient],
);
return (
diff --git a/src/auth/RegisterPage.tsx b/src/auth/RegisterPage.tsx
index 61d394f7..946989c8 100644
--- a/src/auth/RegisterPage.tsx
+++ b/src/auth/RegisterPage.tsx
@@ -78,7 +78,7 @@ export const RegisterPage: FC = () => {
password,
userName,
recaptchaResponse,
- passwordlessUser
+ passwordlessUser,
);
if (client && client?.groupCallEventHandler && passwordlessUser) {
@@ -135,7 +135,7 @@ export const RegisterPage: FC = () => {
execute,
client,
setClient,
- ]
+ ],
);
useEffect(() => {
diff --git a/src/auth/useInteractiveLogin.ts b/src/auth/useInteractiveLogin.ts
index 28288fee..83767f51 100644
--- a/src/auth/useInteractiveLogin.ts
+++ b/src/auth/useInteractiveLogin.ts
@@ -24,13 +24,13 @@ import { Session } from "../ClientContext";
export function useInteractiveLogin(): (
homeserver: string,
username: string,
- password: string
+ password: string,
) => Promise<[MatrixClient, Session]> {
return useCallback<
(
homeserver: string,
username: string,
- password: string
+ password: string,
) => Promise<[MatrixClient, Session]>
>(async (homeserver: string, username: string, password: string) => {
const authClient = createClient({ baseUrl: homeserver });
@@ -70,7 +70,7 @@ export function useInteractiveLogin(): (
userId: user_id,
deviceId: device_id,
},
- false
+ false,
);
/* eslint-enable camelcase */
return [client, session];
diff --git a/src/auth/useInteractiveRegistration.ts b/src/auth/useInteractiveRegistration.ts
index 70ce0c2f..9a69da6a 100644
--- a/src/auth/useInteractiveRegistration.ts
+++ b/src/auth/useInteractiveRegistration.ts
@@ -30,14 +30,14 @@ export const useInteractiveRegistration = (): {
password: string,
displayName: string,
recaptchaResponse: string,
- passwordlessUser: boolean
+ passwordlessUser: boolean,
) => Promise<[MatrixClient, Session]>;
} => {
const [privacyPolicyUrl, setPrivacyPolicyUrl] = useState(
- undefined
+ undefined,
);
const [recaptchaKey, setRecaptchaKey] = useState(
- undefined
+ undefined,
);
const authClient = useRef();
@@ -50,7 +50,7 @@ export const useInteractiveRegistration = (): {
useEffect(() => {
authClient.current!.registerRequest({}).catch((error) => {
setPrivacyPolicyUrl(
- error.data?.params["m.login.terms"]?.policies?.privacy_policy?.en?.url
+ error.data?.params["m.login.terms"]?.policies?.privacy_policy?.en?.url,
);
setRecaptchaKey(error.data?.params["m.login.recaptcha"]?.public_key);
});
@@ -62,7 +62,7 @@ export const useInteractiveRegistration = (): {
password: string,
displayName: string,
recaptchaResponse: string,
- passwordlessUser: boolean
+ passwordlessUser: boolean,
): Promise<[MatrixClient, Session]> => {
const interactiveAuth = new InteractiveAuth({
matrixClient: authClient.current!,
@@ -106,7 +106,7 @@ export const useInteractiveRegistration = (): {
userId: user_id,
deviceId: device_id,
},
- false
+ false,
);
await client.setDisplayName(displayName);
@@ -129,7 +129,7 @@ export const useInteractiveRegistration = (): {
return [client, session];
},
- []
+ [],
);
return { privacyPolicyUrl, recaptchaKey, register };
diff --git a/src/auth/useRecaptcha.ts b/src/auth/useRecaptcha.ts
index b5d44d96..b7583cd4 100644
--- a/src/auth/useRecaptcha.ts
+++ b/src/auth/useRecaptcha.ts
@@ -108,7 +108,7 @@ export function useRecaptcha(sitekey?: string): {
window.grecaptcha.execute();
const iframe = document.querySelector(
- 'iframe[src*="recaptcha/api2/bframe"]'
+ 'iframe[src*="recaptcha/api2/bframe"]',
);
if (iframe?.parentNode?.parentNode) {
diff --git a/src/auth/useRegisterPasswordlessUser.ts b/src/auth/useRegisterPasswordlessUser.ts
index 983789ba..d34a479e 100644
--- a/src/auth/useRegisterPasswordlessUser.ts
+++ b/src/auth/useRegisterPasswordlessUser.ts
@@ -48,7 +48,7 @@ export function useRegisterPasswordlessUser(): UseRegisterPasswordlessUserType {
randomString(16),
displayName,
recaptchaResponse,
- true
+ true,
);
setClient({ client, session });
} catch (e) {
@@ -56,7 +56,7 @@ export function useRegisterPasswordlessUser(): UseRegisterPasswordlessUserType {
throw e;
}
},
- [execute, reset, register, setClient]
+ [execute, reset, register, setClient],
);
return { privacyPolicyUrl, registerPasswordlessUser, recaptchaId };
diff --git a/src/button/Button.module.css b/src/button/Button.module.css
index d5cc8b15..7f915648 100644
--- a/src/button/Button.module.css
+++ b/src/button/Button.module.css
@@ -146,7 +146,9 @@ limitations under the License.
.copyButton {
width: 100%;
height: 40px;
- transition: border-color 250ms, background-color 250ms;
+ transition:
+ border-color 250ms,
+ background-color 250ms;
}
.copyButton span {
diff --git a/src/button/Button.tsx b/src/button/Button.tsx
index 2149a148..933be484 100644
--- a/src/button/Button.tsx
+++ b/src/button/Button.tsx
@@ -94,12 +94,12 @@ export const Button = forwardRef(
onPressStart,
...rest
},
- ref
+ ref,
) => {
const buttonRef = useObjectRef(ref);
const { buttonProps } = useButton(
{ onPress, onPressStart, ...rest },
- buttonRef
+ buttonRef,
);
// TODO: react-aria's useButton hook prevents form submission via keyboard
@@ -121,7 +121,7 @@ export const Button = forwardRef(
{
[styles.on]: on,
[styles.off]: off,
- }
+ },
)}
{...mergeProps(rest, filteredButtonProps)}
ref={buttonRef}
@@ -132,7 +132,7 @@ export const Button = forwardRef(
>
);
- }
+ },
);
export const MicButton: FC<{
diff --git a/src/button/LinkButton.tsx b/src/button/LinkButton.tsx
index 2a94b150..eb30441c 100644
--- a/src/button/LinkButton.tsx
+++ b/src/button/LinkButton.tsx
@@ -47,7 +47,7 @@ export const LinkButton: FC = ({
className={classNames(
variantToClassName[variant || "secondary"],
size ? sizeToClassName[size] : [],
- className
+ className,
)}
to={to}
{...rest}
diff --git a/src/config/Config.ts b/src/config/Config.ts
index f414c58b..0930af49 100644
--- a/src/config/Config.ts
+++ b/src/config/Config.ts
@@ -57,7 +57,7 @@ export class Config {
}
async function downloadConfig(
- configJsonFilename: string
+ configJsonFilename: string,
): Promise {
const url = new URL(configJsonFilename, window.location.href);
url.searchParams.set("cachebuster", Date.now().toString());
diff --git a/src/e2ee/sharedKeyManagement.ts b/src/e2ee/sharedKeyManagement.ts
index 06183878..21c54481 100644
--- a/src/e2ee/sharedKeyManagement.ts
+++ b/src/e2ee/sharedKeyManagement.ts
@@ -26,7 +26,7 @@ export const getRoomSharedKeyLocalStorageKey = (roomId: string): string =>
`room-shared-key-${roomId}`;
const useInternalRoomSharedKey = (
- roomId: string
+ roomId: string,
): [string | null, (value: string) => void] => {
const key = useMemo(() => getRoomSharedKeyLocalStorageKey(roomId), [roomId]);
const [e2eeEnabled] = useEnableE2EE();
@@ -68,6 +68,6 @@ export const useIsRoomE2EE = (roomId: string): boolean | null => {
// should inspect the e2eEnabled URL parameter here?
return useMemo(
() => widget === null && (room === null || !room.getCanonicalAlias()),
- [room]
+ [room],
);
};
diff --git a/src/form/Form.tsx b/src/form/Form.tsx
index 54961791..1f66ac1a 100644
--- a/src/form/Form.tsx
+++ b/src/form/Form.tsx
@@ -36,5 +36,5 @@ export const Form = forwardRef(
{children}
);
- }
+ },
);
diff --git a/src/home/CallList.tsx b/src/home/CallList.tsx
index 227ea535..187228b9 100644
--- a/src/home/CallList.tsx
+++ b/src/home/CallList.tsx
@@ -74,7 +74,7 @@ const CallTile: FC = ({ name, avatarUrl, room }) => {
to={getRelativeRoomUrl(
room.roomId,
room.name,
- roomSharedKey ?? undefined
+ roomSharedKey ?? undefined,
)}
className={styles.callTileLink}
>
@@ -92,7 +92,7 @@ const CallTile: FC = ({ name, avatarUrl, room }) => {
value={getAbsoluteRoomUrl(
room.roomId,
room.name,
- roomSharedKey ?? undefined
+ roomSharedKey ?? undefined,
)}
/>
diff --git a/src/home/RegisteredView.tsx b/src/home/RegisteredView.tsx
index d4ada1e4..4a130899 100644
--- a/src/home/RegisteredView.tsx
+++ b/src/home/RegisteredView.tsx
@@ -56,7 +56,7 @@ export const RegisteredView: FC = ({ client }) => {
useState(false);
const onDismissJoinExistingCallModal = useCallback(
() => setJoinExistingCallModalOpen(false),
- [setJoinExistingCallModalOpen]
+ [setJoinExistingCallModalOpen],
);
const [e2eeEnabled] = useEnableE2EE();
@@ -77,15 +77,15 @@ export const RegisteredView: FC = ({ client }) => {
const createRoomResult = await createRoom(
client,
roomName,
- e2eeEnabled ?? false
+ e2eeEnabled ?? false,
);
history.push(
getRelativeRoomUrl(
createRoomResult.roomId,
roomName,
- createRoomResult.password
- )
+ createRoomResult.password,
+ ),
);
}
@@ -102,7 +102,7 @@ export const RegisteredView: FC = ({ client }) => {
}
});
},
- [client, history, setJoinExistingCallModalOpen, e2eeEnabled]
+ [client, history, setJoinExistingCallModalOpen, e2eeEnabled],
);
const recentRooms = useGroupCallRooms(client);
diff --git a/src/home/UnauthenticatedView.tsx b/src/home/UnauthenticatedView.tsx
index a0914ca7..beb419db 100644
--- a/src/home/UnauthenticatedView.tsx
+++ b/src/home/UnauthenticatedView.tsx
@@ -57,7 +57,7 @@ export const UnauthenticatedView: FC = () => {
useState(false);
const onDismissJoinExistingCallModal = useCallback(
() => setJoinExistingCallModalOpen(false),
- [setJoinExistingCallModalOpen]
+ [setJoinExistingCallModalOpen],
);
const [onFinished, setOnFinished] = useState<() => void>();
const history = useHistory();
@@ -82,7 +82,7 @@ export const UnauthenticatedView: FC = () => {
randomString(16),
displayName,
recaptchaResponse,
- true
+ true,
);
let createRoomResult;
@@ -90,7 +90,7 @@ export const UnauthenticatedView: FC = () => {
createRoomResult = await createRoom(
client,
roomName,
- e2eeEnabled ?? false
+ e2eeEnabled ?? false,
);
} catch (error) {
if (!setClient) {
@@ -124,8 +124,8 @@ export const UnauthenticatedView: FC = () => {
getRelativeRoomUrl(
createRoomResult.roomId,
roomName,
- createRoomResult.password
- )
+ createRoomResult.password,
+ ),
);
}
@@ -144,7 +144,7 @@ export const UnauthenticatedView: FC = () => {
setJoinExistingCallModalOpen,
setClient,
e2eeEnabled,
- ]
+ ],
);
return (
diff --git a/src/home/useGroupCallRooms.ts b/src/home/useGroupCallRooms.ts
index 6e50dda0..77572ad6 100644
--- a/src/home/useGroupCallRooms.ts
+++ b/src/home/useGroupCallRooms.ts
@@ -47,7 +47,7 @@ function getLastTs(client: MatrixClient, r: Room): number {
if (r.getMyMembership() !== "join") {
const membershipEvent = r.currentState.getStateEvents(
"m.room.member",
- myUserId
+ myUserId,
);
if (membershipEvent && !Array.isArray(membershipEvent)) {
@@ -115,7 +115,7 @@ export function useGroupCallRooms(client: MatrixClient): GroupCallRoom[] {
client.removeListener(GroupCallEventHandlerEvent.Incoming, updateRooms);
client.removeListener(
GroupCallEventHandlerEvent.Participants,
- updateRooms
+ updateRooms,
);
};
}, [client]);
diff --git a/src/index.css b/src/index.css
index d9f7d052..f647e87c 100644
--- a/src/index.css
+++ b/src/index.css
@@ -68,7 +68,8 @@ limitations under the License.
font-weight: 400;
font-display: swap;
unicode-range: var(--inter-unicode-range);
- src: url("/fonts/Inter/Inter-Regular.woff2") format("woff2"),
+ src:
+ url("/fonts/Inter/Inter-Regular.woff2") format("woff2"),
url("/fonts/Inter/Inter-Regular.woff") format("woff");
}
@@ -78,7 +79,8 @@ limitations under the License.
font-weight: 400;
font-display: swap;
unicode-range: var(--inter-unicode-range);
- src: url("/fonts/Inter/Inter-Italic.woff2") format("woff2"),
+ src:
+ url("/fonts/Inter/Inter-Italic.woff2") format("woff2"),
url("/fonts/Inter/Inter-Italic.woff") format("woff");
}
@@ -88,7 +90,8 @@ limitations under the License.
font-weight: 500;
font-display: swap;
unicode-range: var(--inter-unicode-range);
- src: url("/fonts/Inter/Inter-Medium.woff2") format("woff2"),
+ src:
+ url("/fonts/Inter/Inter-Medium.woff2") format("woff2"),
url("/fonts/Inter/Inter-Medium.woff") format("woff");
}
@@ -98,7 +101,8 @@ limitations under the License.
font-weight: 500;
font-display: swap;
unicode-range: var(--inter-unicode-range);
- src: url("/fonts/Inter/Inter-MediumItalic.woff2") format("woff2"),
+ src:
+ url("/fonts/Inter/Inter-MediumItalic.woff2") format("woff2"),
url("/fonts/Inter/Inter-MediumItalic.woff") format("woff");
}
@@ -108,7 +112,8 @@ limitations under the License.
font-weight: 600;
font-display: swap;
unicode-range: var(--inter-unicode-range);
- src: url("/fonts/Inter/Inter-SemiBold.woff2") format("woff2"),
+ src:
+ url("/fonts/Inter/Inter-SemiBold.woff2") format("woff2"),
url("/fonts/Inter/Inter-SemiBold.woff") format("woff");
}
@@ -118,7 +123,8 @@ limitations under the License.
font-weight: 600;
font-display: swap;
unicode-range: var(--inter-unicode-range);
- src: url("/fonts/Inter/Inter-SemiBoldItalic.woff2") format("woff2"),
+ src:
+ url("/fonts/Inter/Inter-SemiBoldItalic.woff2") format("woff2"),
url("/fonts/Inter/Inter-SemiBoldItalic.woff") format("woff");
}
@@ -128,7 +134,8 @@ limitations under the License.
font-weight: 700;
font-display: swap;
unicode-range: var(--inter-unicode-range);
- src: url("/fonts/Inter/Inter-Bold.woff2") format("woff2"),
+ src:
+ url("/fonts/Inter/Inter-Bold.woff2") format("woff2"),
url("/fonts/Inter/Inter-Bold.woff") format("woff");
}
@@ -138,7 +145,8 @@ limitations under the License.
font-weight: 700;
font-display: swap;
unicode-range: var(--inter-unicode-range);
- src: url("/fonts/Inter/Inter-BoldItalic.woff2") format("woff2"),
+ src:
+ url("/fonts/Inter/Inter-BoldItalic.woff2") format("woff2"),
url("/fonts/Inter/Inter-BoldItalic.woff") format("woff");
}
diff --git a/src/initializer.tsx b/src/initializer.tsx
index d2bbb076..57000936 100644
--- a/src/initializer.tsx
+++ b/src/initializer.tsx
@@ -99,13 +99,13 @@ export class Initializer {
if (fontScale !== null) {
document.documentElement.style.setProperty(
"--font-scale",
- fontScale.toString()
+ fontScale.toString(),
);
}
if (fonts.length > 0) {
document.documentElement.style.setProperty(
"--font-family",
- fonts.map((f) => `"${f}"`).join(", ")
+ fonts.map((f) => `"${f}"`).join(", "),
);
}
diff --git a/src/input/AvatarInputField.tsx b/src/input/AvatarInputField.tsx
index 5e6198d4..266f2717 100644
--- a/src/input/AvatarInputField.tsx
+++ b/src/input/AvatarInputField.tsx
@@ -52,7 +52,7 @@ export const AvatarInputField = forwardRef(
onRemoveAvatar,
...rest
},
- ref
+ ref,
) => {
const { t } = useTranslation();
@@ -120,5 +120,5 @@ export const AvatarInputField = forwardRef(
)}
);
- }
+ },
);
diff --git a/src/input/Input.module.css b/src/input/Input.module.css
index dc1bde19..b81a903f 100644
--- a/src/input/Input.module.css
+++ b/src/input/Input.module.css
@@ -85,8 +85,11 @@ limitations under the License.
}
.inputField label {
- transition: font-size 0.25s ease-out 0.1s, color 0.25s ease-out 0.1s,
- top 0.25s ease-out 0.1s, background-color 0.25s ease-out 0.1s;
+ transition:
+ font-size 0.25s ease-out 0.1s,
+ color 0.25s ease-out 0.1s,
+ top 0.25s ease-out 0.1s,
+ background-color 0.25s ease-out 0.1s;
color: var(--cpd-color-text-secondary);
background-color: transparent;
font-size: var(--font-size-body);
@@ -118,8 +121,11 @@ limitations under the License.
.inputField textarea:not(:placeholder-shown) + label,
.inputField.prefix textarea + label {
background-color: var(--cpd-color-bg-canvas-default);
- transition: font-size 0.25s ease-out 0s, color 0.25s ease-out 0s,
- top 0.25s ease-out 0s, background-color 0.25s ease-out 0s;
+ transition:
+ font-size 0.25s ease-out 0s,
+ color 0.25s ease-out 0s,
+ top 0.25s ease-out 0s,
+ background-color 0.25s ease-out 0s;
font-size: var(--font-size-micro);
top: -13px;
padding: 0 2px;
diff --git a/src/input/Input.tsx b/src/input/Input.tsx
index b6826681..24bea83f 100644
--- a/src/input/Input.tsx
+++ b/src/input/Input.tsx
@@ -44,7 +44,7 @@ export function FieldRow({
className={classNames(
styles.fieldRow,
{ [styles.rightAlign]: rightAlign },
- className
+ className,
)}
>
{children}
@@ -102,7 +102,7 @@ export const InputField = forwardRef<
disabled,
...rest
},
- ref
+ ref,
) => {
const descriptionId = useId();
@@ -114,7 +114,7 @@ export const InputField = forwardRef<
[styles.prefix]: !!prefix,
[styles.disabled]: disabled,
},
- className
+ className,
)}
>
{prefix && {prefix}}
@@ -163,7 +163,7 @@ export const InputField = forwardRef<
)}
);
- }
+ },
);
interface ErrorMessageProps {
diff --git a/src/input/SelectInput.tsx b/src/input/SelectInput.tsx
index 0feb346e..f0817582 100644
--- a/src/input/SelectInput.tsx
+++ b/src/input/SelectInput.tsx
@@ -38,7 +38,7 @@ export function SelectInput(props: Props): JSX.Element {
const { labelProps, triggerProps, valueProps, menuProps } = useSelect(
props,
state,
- ref
+ ref,
);
const { buttonProps } = useButton(triggerProps, ref);
diff --git a/src/livekit/MediaDevicesContext.tsx b/src/livekit/MediaDevicesContext.tsx
index ddd23b9d..df5b3fd9 100644
--- a/src/livekit/MediaDevicesContext.tsx
+++ b/src/livekit/MediaDevicesContext.tsx
@@ -51,7 +51,7 @@ export interface MediaDevices {
// Cargo-culted from @livekit/components-react
function useObservableState(
observable: Observable | undefined,
- startWith: T
+ startWith: T,
): T {
const [state, setState] = useState(startWith);
useEffect(() => {
@@ -67,7 +67,7 @@ function useMediaDevice(
kind: MediaDeviceKind,
fallbackDevice: string | undefined,
usingNames: boolean,
- alwaysDefault: boolean = false
+ alwaysDefault: boolean = false,
): MediaDevice {
// Make sure we don't needlessly reset to a device observer without names,
// once permissions are already given
@@ -83,7 +83,7 @@ function useMediaDevice(
// kind, which then results in multiple permissions requests.
const deviceObserver = useMemo(
() => createMediaDeviceObserver(kind, requestPermissions),
- [kind, requestPermissions]
+ [kind, requestPermissions],
);
const available = useObservableState(deviceObserver, []);
const [selectedId, select] = useState(fallbackDevice);
@@ -143,18 +143,18 @@ export const MediaDevicesProvider: FC = ({ children }) => {
const audioInput = useMediaDevice(
"audioinput",
audioInputSetting,
- usingNames
+ usingNames,
);
const audioOutput = useMediaDevice(
"audiooutput",
audioOutputSetting,
useOutputNames,
- alwaysUseDefaultAudio
+ alwaysUseDefaultAudio,
);
const videoInput = useMediaDevice(
"videoinput",
videoInputSetting,
- usingNames
+ usingNames,
);
useEffect(() => {
@@ -176,11 +176,11 @@ export const MediaDevicesProvider: FC = ({ children }) => {
const startUsingDeviceNames = useCallback(
() => setNumCallersUsingNames((n) => n + 1),
- [setNumCallersUsingNames]
+ [setNumCallersUsingNames],
);
const stopUsingDeviceNames = useCallback(
() => setNumCallersUsingNames((n) => n - 1),
- [setNumCallersUsingNames]
+ [setNumCallersUsingNames],
);
const context: MediaDevices = useMemo(
@@ -197,7 +197,7 @@ export const MediaDevicesProvider: FC = ({ children }) => {
videoInput,
startUsingDeviceNames,
stopUsingDeviceNames,
- ]
+ ],
);
return (
@@ -218,7 +218,7 @@ export const useMediaDevices = (): MediaDevices =>
*/
export const useMediaDeviceNames = (
context: MediaDevices,
- enabled = true
+ enabled = true,
): void =>
useEffect(() => {
if (enabled) {
diff --git a/src/livekit/openIDSFU.ts b/src/livekit/openIDSFU.ts
index 3e6779f5..8b447485 100644
--- a/src/livekit/openIDSFU.ts
+++ b/src/livekit/openIDSFU.ts
@@ -42,7 +42,7 @@ export type OpenIDClientParts = Pick<
export function useOpenIDSFU(
client: OpenIDClientParts,
- rtcSession: MatrixRTCSession
+ rtcSession: MatrixRTCSession,
): SFUConfig | undefined {
const [sfuConfig, setSFUConfig] = useState(undefined);
@@ -62,20 +62,20 @@ export function useOpenIDSFU(
export async function getSFUConfigWithOpenID(
client: OpenIDClientParts,
- activeFocus: LivekitFocus
+ activeFocus: LivekitFocus,
): Promise {
const openIdToken = await client.getOpenIdToken();
logger.debug("Got openID token", openIdToken);
try {
logger.info(
- `Trying to get JWT from call's active focus URL of ${activeFocus.livekit_service_url}...`
+ `Trying to get JWT from call's active focus URL of ${activeFocus.livekit_service_url}...`,
);
const sfuConfig = await getLiveKitJWT(
client,
activeFocus.livekit_service_url,
activeFocus.livekit_alias,
- openIdToken
+ openIdToken,
);
logger.info(`Got JWT from call's active focus URL.`);
@@ -83,7 +83,7 @@ export async function getSFUConfigWithOpenID(
} catch (e) {
logger.warn(
`Failed to get JWT from RTC session's active focus URL of ${activeFocus.livekit_service_url}.`,
- e
+ e,
);
return undefined;
}
@@ -93,7 +93,7 @@ async function getLiveKitJWT(
client: OpenIDClientParts,
livekitServiceURL: string,
roomName: string,
- openIDToken: IOpenIDToken
+ openIDToken: IOpenIDToken,
): Promise {
try {
const res = await fetch(livekitServiceURL + "/sfu/get", {
diff --git a/src/livekit/useECConnectionState.ts b/src/livekit/useECConnectionState.ts
index 8e0d44ac..0b18cd10 100644
--- a/src/livekit/useECConnectionState.ts
+++ b/src/livekit/useECConnectionState.ts
@@ -51,7 +51,7 @@ async function doConnect(
livekitRoom: Room,
sfuConfig: SFUConfig,
audioEnabled: boolean,
- audioOptions: AudioCaptureOptions
+ audioOptions: AudioCaptureOptions,
): Promise {
await livekitRoom!.connect(sfuConfig!.url, sfuConfig!.jwt);
@@ -76,12 +76,12 @@ export function useECConnectionState(
initialAudioOptions: AudioCaptureOptions,
initialAudioEnabled: boolean,
livekitRoom?: Room,
- sfuConfig?: SFUConfig
+ sfuConfig?: SFUConfig,
): ECConnectionState {
const [connState, setConnState] = useState(
sfuConfig && livekitRoom
? livekitRoom.state
- : ECAddonConnectionState.ECWaiting
+ : ECAddonConnectionState.ECWaiting,
);
const [isSwitchingFocus, setSwitchingFocus] = useState(false);
@@ -116,7 +116,7 @@ export function useECConnectionState(
!sfuConfigEquals(currentSFUConfig.current, sfuConfig)
) {
logger.info(
- `SFU config changed! URL was ${currentSFUConfig.current?.url} now ${sfuConfig?.url}`
+ `SFU config changed! URL was ${currentSFUConfig.current?.url} now ${sfuConfig?.url}`,
);
(async (): Promise => {
@@ -128,7 +128,7 @@ export function useECConnectionState(
livekitRoom!,
sfuConfig!,
initialAudioEnabled,
- initialAudioOptions
+ initialAudioOptions,
);
} finally {
setIsInDoConnect(false);
@@ -149,7 +149,7 @@ export function useECConnectionState(
livekitRoom!,
sfuConfig!,
initialAudioEnabled,
- initialAudioOptions
+ initialAudioOptions,
).finally(() => setIsInDoConnect(false));
}
diff --git a/src/livekit/useLiveKit.ts b/src/livekit/useLiveKit.ts
index 7c2812d8..c8a5e401 100644
--- a/src/livekit/useLiveKit.ts
+++ b/src/livekit/useLiveKit.ts
@@ -52,7 +52,7 @@ interface UseLivekitResult {
export function useLiveKit(
muteStates: MuteStates,
sfuConfig?: SFUConfig,
- e2eeConfig?: E2EEConfig
+ e2eeConfig?: E2EEConfig,
): UseLivekitResult {
const e2eeOptions = useMemo(() => {
if (!e2eeConfig?.sharedKey) return undefined;
@@ -67,7 +67,7 @@ export function useLiveKit(
if (!e2eeConfig?.sharedKey || !e2eeOptions) return;
(e2eeOptions.keyProvider as ExternalE2EEKeyProvider).setKey(
- e2eeConfig?.sharedKey
+ e2eeConfig?.sharedKey,
);
}, [e2eeOptions, e2eeConfig?.sharedKey]);
@@ -93,7 +93,7 @@ export function useLiveKit(
},
e2ee: e2eeOptions,
}),
- [e2eeOptions]
+ [e2eeOptions],
);
// useECConnectionState creates and publishes an audio track by hand. To keep
@@ -131,7 +131,7 @@ export function useLiveKit(
},
initialMuteStates.current.audio.enabled,
room,
- sfuConfig
+ sfuConfig,
);
// Unblock audio once the connection is finished
@@ -215,11 +215,11 @@ export function useLiveKit(
room.options.audioCaptureDefaults?.deviceId === "default"
) {
const activeMicTrack = Array.from(
- room.localParticipant.audioTracks.values()
+ room.localParticipant.audioTracks.values(),
).find((d) => d.source === Track.Source.Microphone)?.track;
const defaultDevice = device.available.find(
- (d) => d.deviceId === "default"
+ (d) => d.deviceId === "default",
);
if (
defaultDevice &&
@@ -245,7 +245,7 @@ export function useLiveKit(
room
.switchActiveDevice(kind, id)
.catch((e) =>
- logger.error(`Failed to sync ${kind} device with LiveKit`, e)
+ logger.error(`Failed to sync ${kind} device with LiveKit`, e),
);
}
}
diff --git a/src/main.tsx b/src/main.tsx
index e7ef9776..ed64a09c 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -48,7 +48,7 @@ if (!window.isSecureContext) {
fatalError = new Error(
"This app cannot run in an insecure context. To fix this, access the app " +
"via a local loopback address, or serve it over HTTPS.\n" +
- "https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts"
+ "https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts",
);
} else if (!navigator.mediaDevices) {
fatalError = new Error("Your browser does not support WebRTC.");
@@ -66,5 +66,5 @@ const history = createBrowserHistory();
root.render(
-
+ ,
);
diff --git a/src/matrix-utils.ts b/src/matrix-utils.ts
index 48aa8b7a..52c55959 100644
--- a/src/matrix-utils.ts
+++ b/src/matrix-utils.ts
@@ -59,7 +59,7 @@ function waitForSync(client: MatrixClient): Promise {
const onSync = (
state: SyncState,
_old: SyncState | null,
- data?: ISyncStateData
+ data?: ISyncStateData,
): void => {
if (state === "PREPARED") {
client.removeListener(ClientEvent.Sync, onSync);
@@ -83,7 +83,7 @@ function secureRandomString(entropyBytes: number): string {
// yet) so just use the built-in one and convert, replace the chars and strip the
// padding from the end (otherwise we'd need to pull in another dependency).
return btoa(
- key.reduce((acc, current) => acc + String.fromCharCode(current), "")
+ key.reduce((acc, current) => acc + String.fromCharCode(current), ""),
)
.replace("+", "-")
.replace("/", "_")
@@ -101,7 +101,7 @@ function secureRandomString(entropyBytes: number): string {
*/
export async function initClient(
clientOptions: ICreateClientOpts,
- restore: boolean
+ restore: boolean,
): Promise {
await loadOlm();
@@ -148,7 +148,7 @@ export async function initClient(
if (indexedDB) {
const cryptoStoreExists = await IndexedDBCryptoStore.exists(
indexedDB,
- CRYPTO_STORE_NAME
+ CRYPTO_STORE_NAME,
);
if (!cryptoStoreExists) throw new CryptoStoreIntegrityError();
} else if (localStorage) {
@@ -164,7 +164,7 @@ export async function initClient(
if (indexedDB) {
baseOpts.cryptoStore = new IndexedDBCryptoStore(
indexedDB,
- CRYPTO_STORE_NAME
+ CRYPTO_STORE_NAME,
);
} else if (localStorage) {
baseOpts.cryptoStore = new LocalStorageCryptoStore(localStorage);
@@ -198,7 +198,7 @@ export async function initClient(
} catch (error) {
logger.error(
"Error starting matrix client store. Falling back to memory store.",
- error
+ error,
);
client.store = new MemoryStore({ localStorage });
await client.store.startup();
@@ -268,7 +268,7 @@ export function roomNameFromRoomId(roomId: string): string {
.substring(1)
.split("-")
.map((part) =>
- part.length > 0 ? part.charAt(0).toUpperCase() + part.slice(1) : part
+ part.length > 0 ? part.charAt(0).toUpperCase() + part.slice(1) : part,
)
.join(" ")
.toLowerCase();
@@ -297,7 +297,7 @@ interface CreateRoomResult {
export async function createRoom(
client: MatrixClient,
name: string,
- e2ee: boolean
+ e2ee: boolean,
): Promise {
logger.log(`Creating room for group call`);
const createPromise = client.createRoom({
@@ -358,7 +358,7 @@ export async function createRoom(
GroupCallType.Video,
false,
GroupCallIntent.Room,
- true
+ true,
);
let password;
@@ -366,7 +366,7 @@ export async function createRoom(
password = secureRandomString(16);
setLocalStorageItem(
getRoomSharedKeyLocalStorageKey(result.room_id),
- password
+ password,
);
}
@@ -386,7 +386,7 @@ export async function createRoom(
export function getAbsoluteRoomUrl(
roomId: string,
roomName?: string,
- password?: string
+ password?: string,
): string {
return `${window.location.protocol}//${
window.location.host
@@ -402,7 +402,7 @@ export function getAbsoluteRoomUrl(
export function getRelativeRoomUrl(
roomId: string,
roomName?: string,
- password?: string
+ password?: string,
): string {
// The password shouldn't need URL encoding here (we generate URL-safe ones) but encode
// it in case it came from another client that generated a non url-safe one
@@ -419,7 +419,7 @@ export function getRelativeRoomUrl(
export function getAvatarUrl(
client: MatrixClient,
mxcUrl: string,
- avatarSize = 96
+ avatarSize = 96,
): string {
const width = Math.floor(avatarSize * window.devicePixelRatio);
const height = Math.floor(avatarSize * window.devicePixelRatio);
diff --git a/src/media-utils.ts b/src/media-utils.ts
index ec829c76..74e5ca33 100644
--- a/src/media-utils.ts
+++ b/src/media-utils.ts
@@ -23,10 +23,10 @@ limitations under the License.
export async function findDeviceByName(
deviceName: string,
kind: MediaDeviceKind,
- devices: MediaDeviceInfo[]
+ devices: MediaDeviceInfo[],
): Promise {
const deviceInfo = devices.find(
- (d) => d.kind === kind && d.label === deviceName
+ (d) => d.kind === kind && d.label === deviceName,
);
return deviceInfo?.deviceId;
}
diff --git a/src/otel/OTelCall.ts b/src/otel/OTelCall.ts
index c050116e..13157763 100644
--- a/src/otel/OTelCall.ts
+++ b/src/otel/OTelCall.ts
@@ -48,14 +48,14 @@ export class OTelCall {
public userId: string,
public deviceId: string,
public call: MatrixCall,
- public span: Span
+ public span: Span,
) {
if (call.peerConn) {
this.addCallPeerConnListeners();
} else {
this.call.once(
CallEvent.PeerConnectionCreated,
- this.addCallPeerConnListeners
+ this.addCallPeerConnListeners,
);
}
}
@@ -63,46 +63,46 @@ export class OTelCall {
public dispose(): void {
this.call.peerConn?.removeEventListener(
"connectionstatechange",
- this.onCallConnectionStateChanged
+ this.onCallConnectionStateChanged,
);
this.call.peerConn?.removeEventListener(
"signalingstatechange",
- this.onCallSignalingStateChanged
+ this.onCallSignalingStateChanged,
);
this.call.peerConn?.removeEventListener(
"iceconnectionstatechange",
- this.onIceConnectionStateChanged
+ this.onIceConnectionStateChanged,
);
this.call.peerConn?.removeEventListener(
"icegatheringstatechange",
- this.onIceGatheringStateChanged
+ this.onIceGatheringStateChanged,
);
this.call.peerConn?.removeEventListener(
"icecandidateerror",
- this.onIceCandidateError
+ this.onIceCandidateError,
);
}
private addCallPeerConnListeners = (): void => {
this.call.peerConn?.addEventListener(
"connectionstatechange",
- this.onCallConnectionStateChanged
+ this.onCallConnectionStateChanged,
);
this.call.peerConn?.addEventListener(
"signalingstatechange",
- this.onCallSignalingStateChanged
+ this.onCallSignalingStateChanged,
);
this.call.peerConn?.addEventListener(
"iceconnectionstatechange",
- this.onIceConnectionStateChanged
+ this.onIceConnectionStateChanged,
);
this.call.peerConn?.addEventListener(
"icegatheringstatechange",
- this.onIceGatheringStateChanged
+ this.onIceGatheringStateChanged,
);
this.call.peerConn?.addEventListener(
"icecandidateerror",
- this.onIceCandidateError
+ this.onIceCandidateError,
);
};
@@ -147,8 +147,8 @@ export class OTelCall {
new OTelCallFeedMediaStreamSpan(
ElementCallOpenTelemetry.instance,
this.span,
- feed
- )
+ feed,
+ ),
);
}
this.trackFeedSpan.get(feed.stream)?.update(feed);
@@ -171,13 +171,13 @@ export class OTelCall {
new OTelCallTransceiverMediaStreamSpan(
ElementCallOpenTelemetry.instance,
this.span,
- transStats
- )
+ transStats,
+ ),
);
}
this.trackTransceiverSpan.get(transStats.mid)?.update(transStats);
prvTransSpan = prvTransSpan.filter(
- (prvStreamId) => prvStreamId !== transStats.mid
+ (prvStreamId) => prvStreamId !== transStats.mid,
);
});
@@ -190,7 +190,7 @@ export class OTelCall {
public end(): void {
this.trackFeedSpan.forEach((feedSpan) => feedSpan.end());
this.trackTransceiverSpan.forEach((transceiverSpan) =>
- transceiverSpan.end()
+ transceiverSpan.end(),
);
this.span.end();
}
diff --git a/src/otel/OTelCallAbstractMediaStreamSpan.ts b/src/otel/OTelCallAbstractMediaStreamSpan.ts
index 66d9d7af..c34f963c 100644
--- a/src/otel/OTelCallAbstractMediaStreamSpan.ts
+++ b/src/otel/OTelCallAbstractMediaStreamSpan.ts
@@ -32,11 +32,11 @@ export abstract class OTelCallAbstractMediaStreamSpan {
public constructor(
protected readonly oTel: ElementCallOpenTelemetry,
protected readonly callSpan: Span,
- protected readonly type: string
+ protected readonly type: string,
) {
const ctx = opentelemetry.trace.setSpan(
opentelemetry.context.active(),
- callSpan
+ callSpan,
);
const options = {
links: [
@@ -54,7 +54,7 @@ export abstract class OTelCallAbstractMediaStreamSpan {
if (!this.trackSpans.has(t.id)) {
this.trackSpans.set(
t.id,
- new OTelCallMediaStreamTrackSpan(this.oTel, this.span, t)
+ new OTelCallMediaStreamTrackSpan(this.oTel, this.span, t),
);
}
this.trackSpans.get(t.id)?.update(t);
diff --git a/src/otel/OTelCallFeedMediaStreamSpan.ts b/src/otel/OTelCallFeedMediaStreamSpan.ts
index e3f0a2f7..02dd2f86 100644
--- a/src/otel/OTelCallFeedMediaStreamSpan.ts
+++ b/src/otel/OTelCallFeedMediaStreamSpan.ts
@@ -29,7 +29,7 @@ export class OTelCallFeedMediaStreamSpan extends OTelCallAbstractMediaStreamSpan
public constructor(
protected readonly oTel: ElementCallOpenTelemetry,
protected readonly callSpan: Span,
- callFeed: CallFeedStats
+ callFeed: CallFeedStats,
) {
const postFix =
callFeed.type === "local" && callFeed.prefix === "from-call-feed"
diff --git a/src/otel/OTelCallMediaStreamTrackSpan.ts b/src/otel/OTelCallMediaStreamTrackSpan.ts
index 9351f723..72fee9b4 100644
--- a/src/otel/OTelCallMediaStreamTrackSpan.ts
+++ b/src/otel/OTelCallMediaStreamTrackSpan.ts
@@ -26,11 +26,11 @@ export class OTelCallMediaStreamTrackSpan {
public constructor(
protected readonly oTel: ElementCallOpenTelemetry,
protected readonly streamSpan: Span,
- data: TrackStats
+ data: TrackStats,
) {
const ctx = opentelemetry.trace.setSpan(
opentelemetry.context.active(),
- streamSpan
+ streamSpan,
);
const options = {
links: [
diff --git a/src/otel/OTelCallTransceiverMediaStreamSpan.ts b/src/otel/OTelCallTransceiverMediaStreamSpan.ts
index 7aeb3d6e..2be5dbe6 100644
--- a/src/otel/OTelCallTransceiverMediaStreamSpan.ts
+++ b/src/otel/OTelCallTransceiverMediaStreamSpan.ts
@@ -32,7 +32,7 @@ export class OTelCallTransceiverMediaStreamSpan extends OTelCallAbstractMediaStr
public constructor(
protected readonly oTel: ElementCallOpenTelemetry,
protected readonly callSpan: Span,
- stats: TransceiverStats
+ stats: TransceiverStats,
) {
super(oTel, callSpan, `matrix.call.transceiver.${stats.mid}`);
this.span.setAttribute("transceiver.mid", stats.mid);
diff --git a/src/otel/OTelGroupCallMembership.ts b/src/otel/OTelGroupCallMembership.ts
index 777aa5f6..b700e2bc 100644
--- a/src/otel/OTelGroupCallMembership.ts
+++ b/src/otel/OTelGroupCallMembership.ts
@@ -62,7 +62,10 @@ export class OTelGroupCallMembership {
};
private readonly speakingSpans = new Map>();
- public constructor(private groupCall: GroupCall, client: MatrixClient) {
+ public constructor(
+ private groupCall: GroupCall,
+ client: MatrixClient,
+ ) {
const clientId = client.getUserId();
if (clientId) {
this.myUserId = clientId;
@@ -79,7 +82,7 @@ export class OTelGroupCallMembership {
public dispose(): void {
this.groupCall.removeListener(
GroupCallEvent.CallsChanged,
- this.onCallsChanged
+ this.onCallsChanged,
);
}
@@ -93,22 +96,22 @@ export class OTelGroupCallMembership {
// Create the main span that tracks the time we intend to be in the call
this.callMembershipSpan =
ElementCallOpenTelemetry.instance.tracer.startSpan(
- "matrix.groupCallMembership"
+ "matrix.groupCallMembership",
);
this.callMembershipSpan.setAttribute(
"matrix.confId",
- this.groupCall.groupCallId
+ this.groupCall.groupCallId,
);
this.callMembershipSpan.setAttribute("matrix.userId", this.myUserId);
this.callMembershipSpan.setAttribute("matrix.deviceId", this.myDeviceId);
this.callMembershipSpan.setAttribute(
"matrix.displayName",
- this.myMember ? this.myMember.name : "unknown-name"
+ this.myMember ? this.myMember.name : "unknown-name",
);
this.groupCallContext = opentelemetry.trace.setSpan(
opentelemetry.context.active(),
- this.callMembershipSpan
+ this.callMembershipSpan,
);
this.callMembershipSpan?.addEvent("matrix.joinCall");
@@ -138,7 +141,7 @@ export class OTelGroupCallMembership {
this.callMembershipSpan?.addEvent(
`matrix.roomStateEvent_${event.getType()}`,
- ObjectFlattener.flattenVoipEvent(event.getContent())
+ ObjectFlattener.flattenVoipEvent(event.getContent()),
);
}
@@ -150,7 +153,7 @@ export class OTelGroupCallMembership {
const span = ElementCallOpenTelemetry.instance.tracer.startSpan(
`matrix.call`,
undefined,
- this.groupCallContext
+ this.groupCallContext,
);
// XXX: anonymity
span.setAttribute("matrix.call.target.userId", userId);
@@ -160,7 +163,7 @@ export class OTelGroupCallMembership {
span.setAttribute("matrix.call.target.displayName", displayName);
this.callsByCallId.set(
call.callId,
- new OTelCall(userId, deviceId, call, span)
+ new OTelCall(userId, deviceId, call, span),
);
}
}
@@ -210,12 +213,12 @@ export class OTelGroupCallMembership {
if (event.type === "toDevice") {
callTrackingInfo.span.addEvent(
`matrix.sendToDeviceEvent_${event.eventType}`,
- ObjectFlattener.flattenVoipEvent(event)
+ ObjectFlattener.flattenVoipEvent(event),
);
} else if (event.type === "sendEvent") {
callTrackingInfo.span.addEvent(
`matrix.sendToRoomEvent_${event.eventType}`,
- ObjectFlattener.flattenVoipEvent(event)
+ ObjectFlattener.flattenVoipEvent(event),
);
}
}
@@ -239,7 +242,7 @@ export class OTelGroupCallMembership {
"matrix.receive_voip_event_unknown_callid",
{
"sender.userId": event.getSender(),
- }
+ },
);
logger.error("Received call event for unknown call ID " + callId);
return;
@@ -284,7 +287,7 @@ export class OTelGroupCallMembership {
public onSpeaking(
member: RoomMember,
deviceId: string,
- speaking: boolean
+ speaking: boolean,
): void {
if (speaking) {
// Ensure that there's an audio activity span for this speaker
@@ -298,7 +301,7 @@ export class OTelGroupCallMembership {
const span = ElementCallOpenTelemetry.instance.tracer.startSpan(
"matrix.audioActivity",
undefined,
- this.groupCallContext
+ this.groupCallContext,
);
span.setAttribute("matrix.userId", member.userId);
span.setAttribute("matrix.displayName", member.rawDisplayName);
@@ -336,7 +339,7 @@ export class OTelGroupCallMembership {
}
public onCallFeedStatsReport(
- report: GroupCallStatsReport
+ report: GroupCallStatsReport,
): void {
if (!ElementCallOpenTelemetry.instance) return;
let call: OTelCall | undefined;
@@ -354,10 +357,10 @@ export class OTelGroupCallMembership {
"call.opponentMemberId": report.report?.opponentMemberId
? report.report?.opponentMemberId
: "unknown",
- }
+ },
);
logger.error(
- `Received ${OTelStatsReportType.CallFeedReport} with unknown call ID: ${callId}`
+ `Received ${OTelStatsReportType.CallFeedReport} with unknown call ID: ${callId}`,
);
return;
} else {
@@ -367,26 +370,26 @@ export class OTelGroupCallMembership {
}
public onConnectionStatsReport(
- statsReport: GroupCallStatsReport
+ statsReport: GroupCallStatsReport,
): void {
this.buildCallStatsSpan(
OTelStatsReportType.ConnectionReport,
- statsReport.report
+ statsReport.report,
);
}
public onByteSentStatsReport(
- statsReport: GroupCallStatsReport
+ statsReport: GroupCallStatsReport,
): void {
this.buildCallStatsSpan(
OTelStatsReportType.ByteSentReport,
- statsReport.report
+ statsReport.report,
);
}
public buildCallStatsSpan(
type: OTelStatsReportType,
- report: ByteSentStatsReport | ConnectionStatsReport
+ report: ByteSentStatsReport | ConnectionStatsReport,
): void {
if (!ElementCallOpenTelemetry.instance) return;
let call: OTelCall | undefined;
@@ -409,7 +412,7 @@ export class OTelGroupCallMembership {
const data = ObjectFlattener.flattenReportObject(type, report);
const ctx = opentelemetry.trace.setSpan(
opentelemetry.context.active(),
- call.span
+ call.span,
);
const options = {
@@ -423,20 +426,20 @@ export class OTelGroupCallMembership {
const span = ElementCallOpenTelemetry.instance.tracer.startSpan(
type,
options,
- ctx
+ ctx,
);
span.setAttribute("matrix.callId", callId ?? "unknown");
span.setAttribute(
"matrix.opponentMemberId",
- report.opponentMemberId ? report.opponentMemberId : "unknown"
+ report.opponentMemberId ? report.opponentMemberId : "unknown",
);
span.addEvent("matrix.call.connection_stats_event", data);
span.end();
}
public onSummaryStatsReport(
- statsReport: GroupCallStatsReport
+ statsReport: GroupCallStatsReport,
): void {
if (!ElementCallOpenTelemetry.instance) return;
@@ -445,12 +448,12 @@ export class OTelGroupCallMembership {
if (this.statsReportSpan.span === undefined && this.callMembershipSpan) {
const ctx = setSpan(
opentelemetry.context.active(),
- this.callMembershipSpan
+ this.callMembershipSpan,
);
const span = ElementCallOpenTelemetry.instance?.tracer.startSpan(
"matrix.groupCallMembership.summaryReport",
undefined,
- ctx
+ ctx,
);
if (span === undefined) {
return;
@@ -459,7 +462,7 @@ export class OTelGroupCallMembership {
span.setAttribute("matrix.userId", this.myUserId);
span.setAttribute(
"matrix.displayName",
- this.myMember ? this.myMember.name : "unknown-name"
+ this.myMember ? this.myMember.name : "unknown-name",
);
span.addEvent(type, data);
span.end();
diff --git a/src/otel/ObjectFlattener.ts b/src/otel/ObjectFlattener.ts
index 715517d2..76de9e3a 100644
--- a/src/otel/ObjectFlattener.ts
+++ b/src/otel/ObjectFlattener.ts
@@ -25,7 +25,7 @@ import {
export class ObjectFlattener {
public static flattenReportObject(
prefix: string,
- report: ConnectionStatsReport | ByteSentStatsReport
+ report: ConnectionStatsReport | ByteSentStatsReport,
): Attributes {
const flatObject = {};
ObjectFlattener.flattenObjectRecursive(report, flatObject, `${prefix}.`, 0);
@@ -33,27 +33,27 @@ export class ObjectFlattener {
}
public static flattenByteSentStatsReportObject(
- statsReport: GroupCallStatsReport
+ statsReport: GroupCallStatsReport,
): Attributes {
const flatObject = {};
ObjectFlattener.flattenObjectRecursive(
statsReport.report,
flatObject,
"matrix.stats.bytesSent.",
- 0
+ 0,
);
return flatObject;
}
public static flattenSummaryStatsReportObject(
- statsReport: GroupCallStatsReport
+ statsReport: GroupCallStatsReport,
): Attributes {
const flatObject = {};
ObjectFlattener.flattenObjectRecursive(
statsReport.report,
flatObject,
"matrix.stats.summary.",
- 0
+ 0,
);
return flatObject;
}
@@ -67,7 +67,7 @@ export class ObjectFlattener {
event as unknown as Record, // XXX Types
flatObject,
"matrix.event.",
- 0
+ 0,
);
return flatObject;
@@ -77,12 +77,12 @@ export class ObjectFlattener {
obj: Object,
flatObject: Attributes,
prefix: string,
- depth: number
+ depth: number,
): void {
if (depth > 10)
throw new Error(
"Depth limit exceeded: aborting VoipEvent recursion. Prefix is " +
- prefix
+ prefix,
);
let entries;
if (obj instanceof Map) {
@@ -101,7 +101,7 @@ export class ObjectFlattener {
v,
flatObject,
prefix + k + ".",
- depth + 1
+ depth + 1,
);
}
}
diff --git a/src/otel/otel.ts b/src/otel/otel.ts
index c6a1b971..14c22cb6 100644
--- a/src/otel/otel.ts
+++ b/src/otel/otel.ts
@@ -50,7 +50,7 @@ export class ElementCallOpenTelemetry {
sharedInstance = new ElementCallOpenTelemetry(
config.opentelemetry?.collector_url,
- config.rageshake?.submit_url
+ config.rageshake?.submit_url,
);
}
}
@@ -61,7 +61,7 @@ export class ElementCallOpenTelemetry {
private constructor(
collectorUrl: string | undefined,
- rageshakeUrl: string | undefined
+ rageshakeUrl: string | undefined,
) {
// This is how we can make Jaeger show a reasonable service in the dropdown on the left.
const providerConfig = {
@@ -77,7 +77,7 @@ export class ElementCallOpenTelemetry {
url: collectorUrl,
});
this._provider.addSpanProcessor(
- new SimpleSpanProcessor(this.otlpExporter)
+ new SimpleSpanProcessor(this.otlpExporter),
);
} else {
logger.info("OTLP collector disabled");
@@ -93,7 +93,7 @@ export class ElementCallOpenTelemetry {
this._tracer = opentelemetry.trace.getTracer(
// This is not the serviceName shown in jaeger
- "my-element-call-otl-tracer"
+ "my-element-call-otl-tracer",
);
}
diff --git a/src/popover/Popover.tsx b/src/popover/Popover.tsx
index 02662eb5..36a4ac4a 100644
--- a/src/popover/Popover.tsx
+++ b/src/popover/Popover.tsx
@@ -40,7 +40,7 @@ export const Popover = forwardRef(
shouldCloseOnBlur: true,
isDismissable: true,
},
- popoverRef
+ popoverRef,
);
return (
@@ -56,5 +56,5 @@ export const Popover = forwardRef(
);
- }
+ },
);
diff --git a/src/popover/PopoverMenu.tsx b/src/popover/PopoverMenu.tsx
index faf7fd71..dc38c6d0 100644
--- a/src/popover/PopoverMenu.tsx
+++ b/src/popover/PopoverMenu.tsx
@@ -43,7 +43,7 @@ export const PopoverMenuTrigger = forwardRef<
const { menuTriggerProps, menuProps } = useMenuTrigger(
{},
popoverMenuState,
- buttonRef
+ buttonRef,
);
const popoverRef = useRef(null);
@@ -62,7 +62,7 @@ export const PopoverMenuTrigger = forwardRef<
typeof children[1] !== "function"
) {
throw new Error(
- "PopoverMenu must have two props. The first being a button and the second being a render prop."
+ "PopoverMenu must have two props. The first being a button and the second being a render prop.",
);
}
diff --git a/src/profile/useProfile.ts b/src/profile/useProfile.ts
index c88547fa..eba0420f 100644
--- a/src/profile/useProfile.ts
+++ b/src/profile/useProfile.ts
@@ -63,7 +63,7 @@ export function useProfile(client: MatrixClient | undefined): UseProfile {
useEffect(() => {
const onChangeUser = (
_event: MatrixEvent | undefined,
- { displayName, avatarUrl }: User
+ { displayName, avatarUrl }: User,
): void => {
setState({
success: false,
@@ -108,9 +108,8 @@ export function useProfile(client: MatrixClient | undefined): UseProfile {
if (removeAvatar) {
await client.setAvatarUrl("");
} else if (avatar) {
- ({ content_uri: mxcAvatarUrl } = await client.uploadContent(
- avatar
- ));
+ ({ content_uri: mxcAvatarUrl } =
+ await client.uploadContent(avatar));
await client.setAvatarUrl(mxcAvatarUrl);
}
@@ -135,7 +134,7 @@ export function useProfile(client: MatrixClient | undefined): UseProfile {
logger.error("Client not initialized before calling saveProfile");
}
},
- [client]
+ [client],
);
return {
diff --git a/src/room/AppSelectionModal.tsx b/src/room/AppSelectionModal.tsx
index 8220ffbc..8affa12e 100644
--- a/src/room/AppSelectionModal.tsx
+++ b/src/room/AppSelectionModal.tsx
@@ -40,14 +40,14 @@ export const AppSelectionModal: FC = ({ roomId }) => {
e.stopPropagation();
setOpen(false);
},
- [setOpen]
+ [setOpen],
);
const roomSharedKey = useRoomSharedKey(roomId ?? "");
const roomIsEncrypted = useIsRoomE2EE(roomId ?? "");
if (roomIsEncrypted && roomSharedKey === undefined) {
logger.error(
- "Generating app redirect URL for encrypted room but don't have key available!"
+ "Generating app redirect URL for encrypted room but don't have key available!",
);
}
@@ -60,7 +60,7 @@ export const AppSelectionModal: FC = ({ roomId }) => {
const url = new URL(
roomId === null
? window.location.href
- : getAbsoluteRoomUrl(roomId, undefined, roomSharedKey ?? undefined)
+ : getAbsoluteRoomUrl(roomId, undefined, roomSharedKey ?? undefined),
);
// Edit the URL to prevent the app selection prompt from appearing a second
// time within the app, and to keep the user confined to the current room
diff --git a/src/room/CallEndedView.tsx b/src/room/CallEndedView.tsx
index 72567618..32b27568 100644
--- a/src/room/CallEndedView.tsx
+++ b/src/room/CallEndedView.tsx
@@ -64,7 +64,7 @@ export const CallEndedView: FC = ({
PosthogAnalytics.instance.eventQualitySurvey.track(
endedCallId,
feedbackText,
- starRating
+ starRating,
);
setSubmitting(true);
@@ -83,7 +83,7 @@ export const CallEndedView: FC = ({
}, 1000);
}, 1000);
},
- [endedCallId, history, isPasswordlessUser, confineToRoom, starRating]
+ [endedCallId, history, isPasswordlessUser, confineToRoom, starRating],
);
const createAccountDialog = isPasswordlessUser && (
diff --git a/src/room/GroupCallLoader.tsx b/src/room/GroupCallLoader.tsx
index c61f4ca4..720b6487 100644
--- a/src/room/GroupCallLoader.tsx
+++ b/src/room/GroupCallLoader.tsx
@@ -47,7 +47,7 @@ export function GroupCallLoader({
ev.preventDefault();
history.push("/");
},
- [history]
+ [history],
);
switch (groupCallState.kind) {
@@ -66,7 +66,7 @@ export function GroupCallLoader({
{t("Call not found")}
{t(
- "Calls are now end-to-end encrypted and need to be created from the home page. This helps make sure everyone's using the same encryption key."
+ "Calls are now end-to-end encrypted and need to be created from the home page. This helps make sure everyone's using the same encryption key.",
)}
{/* XXX: A 'create it for me' button would be the obvious UX here. Two screens already have
diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx
index 90dfff31..c629a5dc 100644
--- a/src/room/GroupCallView.tsx
+++ b/src/room/GroupCallView.tsx
@@ -111,7 +111,7 @@ export const GroupCallView: FC = ({
// Count each member only once, regardless of how many devices they use
const participantCount = useMemo(
() => new Set(memberships.map((m) => m.sender!)).size,
- [memberships]
+ [memberships],
);
const deviceContext = useMediaDevices();
@@ -126,7 +126,7 @@ export const GroupCallView: FC = ({
if (widget && preload) {
// In preload mode, wait for a join action before entering
const onJoin = async (
- ev: CustomEvent
+ ev: CustomEvent,
): Promise => {
// XXX: I think this is broken currently - LiveKit *won't* request
// permissions and give you device names unless you specify a kind, but
@@ -143,14 +143,14 @@ export const GroupCallView: FC = ({
const deviceId = await findDeviceByName(
audioInput,
"audioinput",
- devices
+ devices,
);
if (!deviceId) {
logger.warn("Unknown audio input: " + audioInput);
latestMuteStates.current!.audio.setEnabled?.(false);
} else {
logger.debug(
- `Found audio input ID ${deviceId} for name ${audioInput}`
+ `Found audio input ID ${deviceId} for name ${audioInput}`,
);
latestDevices.current!.audioInput.select(deviceId);
latestMuteStates.current!.audio.setEnabled?.(true);
@@ -163,14 +163,14 @@ export const GroupCallView: FC = ({
const deviceId = await findDeviceByName(
videoInput,
"videoinput",
- devices
+ devices,
);
if (!deviceId) {
logger.warn("Unknown video input: " + videoInput);
latestMuteStates.current!.video.setEnabled?.(false);
} else {
logger.debug(
- `Found video input ID ${deviceId} for name ${videoInput}`
+ `Found video input ID ${deviceId} for name ${videoInput}`,
);
latestDevices.current!.videoInput.select(deviceId);
latestMuteStates.current!.video.setEnabled?.(true);
@@ -182,7 +182,7 @@ export const GroupCallView: FC = ({
PosthogAnalytics.instance.eventCallEnded.cacheStartCall(new Date());
// we only have room sessions right now, so call ID is the emprty string - we use the room ID
PosthogAnalytics.instance.eventCallStarted.track(
- rtcSession.room.roomId
+ rtcSession.room.roomId,
);
await Promise.all([
@@ -213,7 +213,7 @@ export const GroupCallView: FC = ({
PosthogAnalytics.instance.eventCallEnded.track(
rtcSession.room.roomId,
rtcSession.memberships.length,
- sendInstantly
+ sendInstantly,
);
await leaveRTCSession(rtcSession);
@@ -237,13 +237,13 @@ export const GroupCallView: FC = ({
history.push("/");
}
},
- [rtcSession, isPasswordlessUser, confineToRoom, history]
+ [rtcSession, isPasswordlessUser, confineToRoom, history],
);
useEffect(() => {
if (widget && isJoined) {
const onHangup = async (
- ev: CustomEvent
+ ev: CustomEvent,
): Promise => {
leaveRTCSession(rtcSession);
widget!.api.transport.reply(ev.detail, {});
@@ -260,7 +260,7 @@ export const GroupCallView: FC = ({
const e2eeConfig = useMemo(
() => (e2eeSharedKey ? { sharedKey: e2eeSharedKey } : undefined),
- [e2eeSharedKey]
+ [e2eeSharedKey],
);
const onReconnect = useCallback(() => {
@@ -274,12 +274,12 @@ export const GroupCallView: FC = ({
const [shareModalOpen, setInviteModalOpen] = useState(false);
const onDismissInviteModal = useCallback(
() => setInviteModalOpen(false),
- [setInviteModalOpen]
+ [setInviteModalOpen],
);
const onShareClickFn = useCallback(
() => setInviteModalOpen(true),
- [setInviteModalOpen]
+ [setInviteModalOpen],
);
const onShareClick = joinRule === JoinRule.Public ? onShareClickFn : null;
@@ -288,7 +288,7 @@ export const GroupCallView: FC = ({
ev.preventDefault();
history.push("/");
},
- [history]
+ [history],
);
const { t } = useTranslation();
@@ -298,7 +298,7 @@ export const GroupCallView: FC = ({
@@ -309,7 +309,7 @@ export const GroupCallView: FC = ({
Incompatible Browser
{t(
- "Your web browser does not support media end-to-end encryption. Supported Browsers are Chrome, Safari, Firefox >=117"
+ "Your web browser does not support media end-to-end encryption. Supported Browsers are Chrome, Safari, Firefox >=117",
)}
diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx
index d0b54f8d..9dc124f9 100644
--- a/src/room/InCallView.tsx
+++ b/src/room/InCallView.tsx
@@ -105,7 +105,7 @@ export const ActiveCall: FC = (props) => {
const { livekitRoom, connState } = useLiveKit(
props.muteStates,
sfuConfig,
- props.e2eeConfig
+ props.e2eeConfig,
);
if (!livekitRoom) {
@@ -172,10 +172,10 @@ export const InCallView: FC = ({
[{ source: Track.Source.ScreenShare, withPlaceholder: false }],
{
room: livekitRoom,
- }
+ },
);
const { layout, setLayout } = useVideoGridLayout(
- screenSharingTracks.length > 0
+ screenSharingTracks.length > 0,
);
const [showConnectionStats] = useShowConnectionStats();
@@ -188,11 +188,11 @@ export const InCallView: FC = ({
const toggleMicrophone = useCallback(
() => muteStates.audio.setEnabled?.((e) => !e),
- [muteStates]
+ [muteStates],
);
const toggleCamera = useCallback(
() => muteStates.video.setEnabled?.((e) => !e),
- [muteStates]
+ [muteStates],
);
// This function incorrectly assumes that there is a camera and microphone, which is not always the case.
@@ -201,7 +201,7 @@ export const InCallView: FC = ({
containerRef1,
toggleMicrophone,
toggleCamera,
- (muted) => muteStates.audio.setEnabled?.(!muted)
+ (muted) => muteStates.audio.setEnabled?.(!muted),
);
const onLeavePress = useCallback(() => {
@@ -213,7 +213,7 @@ export const InCallView: FC = ({
layout === "grid"
? ElementWidgetActions.TileLayout
: ElementWidgetActions.SpotlightLayout,
- {}
+ {},
);
}, [layout]);
@@ -231,14 +231,14 @@ export const InCallView: FC = ({
widget.lazyActions.on(ElementWidgetActions.TileLayout, onTileLayout);
widget.lazyActions.on(
ElementWidgetActions.SpotlightLayout,
- onSpotlightLayout
+ onSpotlightLayout,
);
return () => {
widget!.lazyActions.off(ElementWidgetActions.TileLayout, onTileLayout);
widget!.lazyActions.off(
ElementWidgetActions.SpotlightLayout,
- onSpotlightLayout
+ onSpotlightLayout,
);
};
}
@@ -261,7 +261,7 @@ export const InCallView: FC = ({
(noControls
? items.find((item) => item.isSpeaker) ?? items.at(0) ?? null
: null),
- [fullscreenItem, noControls, items]
+ [fullscreenItem, noControls, items],
);
const Grid =
@@ -320,18 +320,18 @@ export const InCallView: FC = ({
};
const rageshakeRequestModalProps = useRageshakeRequestModal(
- rtcSession.room.roomId
+ rtcSession.room.roomId,
);
const [settingsModalOpen, setSettingsModalOpen] = useState(false);
const openSettings = useCallback(
() => setSettingsModalOpen(true),
- [setSettingsModalOpen]
+ [setSettingsModalOpen],
);
const closeSettings = useCallback(
() => setSettingsModalOpen(false),
- [setSettingsModalOpen]
+ [setSettingsModalOpen],
);
const toggleScreensharing = useCallback(async () => {
@@ -365,7 +365,7 @@ export const InCallView: FC = ({
onPress={toggleCamera}
disabled={muteStates.video.setEnabled === null}
data-testid="incall_videomute"
- />
+ />,
);
if (!reducedControls) {
@@ -376,14 +376,18 @@ export const InCallView: FC = ({
enabled={isScreenShareEnabled}
onPress={toggleScreensharing}
data-testid="incall_screenshare"
- />
+ />,
);
}
buttons.push();
}
buttons.push(
-
+ ,
);
footer = (
@@ -447,7 +451,7 @@ export const InCallView: FC = ({
function findMatrixMember(
room: MatrixRoom,
- id: string
+ id: string,
): RoomMember | undefined {
if (!id) return undefined;
@@ -455,7 +459,7 @@ function findMatrixMember(
// must be at least 3 parts because we know the first part is a userId which must necessarily contain a colon
if (parts.length < 3) {
logger.warn(
- "Livekit participants ID doesn't look like a userId:deviceId combination"
+ "Livekit participants ID doesn't look like a userId:deviceId combination",
);
return undefined;
}
@@ -469,7 +473,7 @@ function findMatrixMember(
function useParticipantTiles(
livekitRoom: Room,
matrixRoom: MatrixRoom,
- connState: ECConnectionState
+ connState: ECConnectionState,
): TileDescriptor[] {
const previousTiles = useRef[]>([]);
@@ -498,7 +502,7 @@ function useParticipantTiles(
// connected, this is fine and we'll be in "all ghosts" mode.
if (id !== "" && member === undefined) {
logger.warn(
- `Ruh, roh! No matrix member found for SFU participant '${id}': creating g-g-g-ghost!`
+ `Ruh, roh! No matrix member found for SFU participant '${id}': creating g-g-g-ghost!`,
);
}
allGhosts &&= member === undefined;
@@ -542,11 +546,11 @@ function useParticipantTiles(
return screenShareTile
? [userMediaTile, screenShareTile]
: [userMediaTile];
- }
+ },
);
PosthogAnalytics.instance.eventCallEnded.cacheParticipantCountChanged(
- tiles.length
+ tiles.length,
);
// If every item is a ghost, that probably means we're still connecting and
diff --git a/src/room/InviteModal.tsx b/src/room/InviteModal.tsx
index 33d6ef97..f9d02f2b 100644
--- a/src/room/InviteModal.tsx
+++ b/src/room/InviteModal.tsx
@@ -40,7 +40,7 @@ export const InviteModal: FC = ({ room, open, onDismiss }) => {
const url = useMemo(
() =>
getAbsoluteRoomUrl(room.roomId, room.name, roomSharedKey ?? undefined),
- [room, roomSharedKey]
+ [room, roomSharedKey],
);
const [, setCopied] = useClipboard(url);
const [toastOpen, setToastOpen] = useState(false);
@@ -53,7 +53,7 @@ export const InviteModal: FC = ({ room, open, onDismiss }) => {
onDismiss();
setToastOpen(true);
},
- [setCopied, onDismiss]
+ [setCopied, onDismiss],
);
return (
diff --git a/src/room/LayoutToggle.tsx b/src/room/LayoutToggle.tsx
index 88d9aef7..01738f73 100644
--- a/src/room/LayoutToggle.tsx
+++ b/src/room/LayoutToggle.tsx
@@ -36,7 +36,7 @@ export const LayoutToggle: FC = ({ layout, setLayout, className }) => {
const onChange = useCallback(
(e: ChangeEvent) => setLayout(e.target.value as Layout),
- [setLayout]
+ [setLayout],
);
const spotlightId = useId();
diff --git a/src/room/LobbyView.tsx b/src/room/LobbyView.tsx
index e49b70cf..7116e74c 100644
--- a/src/room/LobbyView.tsx
+++ b/src/room/LobbyView.tsx
@@ -63,22 +63,22 @@ export const LobbyView: FC = ({
const onAudioPress = useCallback(
() => muteStates.audio.setEnabled?.((e) => !e),
- [muteStates]
+ [muteStates],
);
const onVideoPress = useCallback(
() => muteStates.video.setEnabled?.((e) => !e),
- [muteStates]
+ [muteStates],
);
const [settingsModalOpen, setSettingsModalOpen] = useState(false);
const openSettings = useCallback(
() => setSettingsModalOpen(true),
- [setSettingsModalOpen]
+ [setSettingsModalOpen],
);
const closeSettings = useCallback(
() => setSettingsModalOpen(false),
- [setSettingsModalOpen]
+ [setSettingsModalOpen],
);
const history = useHistory();
diff --git a/src/room/MuteStates.ts b/src/room/MuteStates.ts
index 8bdc6420..db1fb22a 100644
--- a/src/room/MuteStates.ts
+++ b/src/room/MuteStates.ts
@@ -49,18 +49,18 @@ export interface MuteStates {
function useMuteState(
device: MediaDevice,
- enabledByDefault: () => boolean
+ enabledByDefault: () => boolean,
): MuteState {
const [enabled, setEnabled] = useReactiveState(
(prev) => device.available.length > 0 && (prev ?? enabledByDefault()),
- [device]
+ [device],
);
return useMemo(
() =>
device.available.length === 0
? deviceUnavailable
: { enabled, setEnabled },
- [device, enabled, setEnabled]
+ [device, enabled, setEnabled],
);
}
@@ -69,7 +69,7 @@ export function useMuteStates(participantCount: number): MuteStates {
const audio = useMuteState(
devices.audioInput,
- () => participantCount <= MUTE_PARTICIPANT_COUNT
+ () => participantCount <= MUTE_PARTICIPANT_COUNT,
);
const video = useMuteState(devices.videoInput, () => true);
diff --git a/src/room/RageshakeRequestModal.tsx b/src/room/RageshakeRequestModal.tsx
index 74debd34..9bc60cdb 100644
--- a/src/room/RageshakeRequestModal.tsx
+++ b/src/room/RageshakeRequestModal.tsx
@@ -47,7 +47,7 @@ export const RageshakeRequestModal: FC = ({
{t(
- "Another user on this call is having an issue. In order to better diagnose these issues we'd like to collect a debug log."
+ "Another user on this call is having an issue. In order to better diagnose these issues we'd like to collect a debug log.",
)}
diff --git a/src/room/RoomAuthView.tsx b/src/room/RoomAuthView.tsx
index ab988d3b..a52a0e8e 100644
--- a/src/room/RoomAuthView.tsx
+++ b/src/room/RoomAuthView.tsx
@@ -52,7 +52,7 @@ export const RoomAuthView: FC = () => {
setError(error);
});
},
- [registerPasswordlessUser]
+ [registerPasswordlessUser],
);
const { t } = useTranslation();
diff --git a/src/room/RoomPage.tsx b/src/room/RoomPage.tsx
index ffc9562a..9bcb8a81 100644
--- a/src/room/RoomPage.tsx
+++ b/src/room/RoomPage.tsx
@@ -81,7 +81,7 @@ export const RoomPage: FC = () => {
hideHeader={hideHeader}
/>
),
- [client, passwordlessUser, confineToRoom, preload, hideHeader]
+ [client, passwordlessUser, confineToRoom, preload, hideHeader],
);
let content: ReactNode;
diff --git a/src/room/VideoPreview.tsx b/src/room/VideoPreview.tsx
index 36323ba9..df4d1480 100644
--- a/src/room/VideoPreview.tsx
+++ b/src/room/VideoPreview.tsx
@@ -82,14 +82,14 @@ export const VideoPreview: FC = ({
},
(error) => {
logger.error("Error while creating preview Tracks:", error);
- }
+ },
);
const videoTrack = useMemo(
() =>
tracks?.find((t) => t.kind === Track.Kind.Video) as
| LocalVideoTrack
| undefined,
- [tracks]
+ [tracks],
);
const videoEl = useRef(null);
diff --git a/src/room/useActiveFocus.ts b/src/room/useActiveFocus.ts
index a62ffafd..022b25ac 100644
--- a/src/room/useActiveFocus.ts
+++ b/src/room/useActiveFocus.ts
@@ -24,7 +24,7 @@ import { deepCompare } from "matrix-js-sdk/src/utils";
import { LivekitFocus } from "../livekit/LivekitFocus";
function getActiveFocus(
- rtcSession: MatrixRTCSession
+ rtcSession: MatrixRTCSession,
): LivekitFocus | undefined {
const oldestMembership = rtcSession.getOldestMembership();
return oldestMembership?.getActiveFoci()[0] as LivekitFocus;
@@ -36,10 +36,10 @@ function getActiveFocus(
* and the same focus.
*/
export function useActiveFocus(
- rtcSession: MatrixRTCSession
+ rtcSession: MatrixRTCSession,
): LivekitFocus | undefined {
const [activeFocus, setActiveFocus] = useState(() =>
- getActiveFocus(rtcSession)
+ getActiveFocus(rtcSession),
);
const onMembershipsChanged = useCallback(() => {
@@ -53,13 +53,13 @@ export function useActiveFocus(
useEffect(() => {
rtcSession.on(
MatrixRTCSessionEvent.MembershipsChanged,
- onMembershipsChanged
+ onMembershipsChanged,
);
return () => {
rtcSession.off(
MatrixRTCSessionEvent.MembershipsChanged,
- onMembershipsChanged
+ onMembershipsChanged,
);
};
});
diff --git a/src/room/useFullscreen.ts b/src/room/useFullscreen.ts
index 684ee9bc..38469808 100644
--- a/src/room/useFullscreen.ts
+++ b/src/room/useFullscreen.ts
@@ -66,7 +66,7 @@ export function useFullscreen(items: TileDescriptor[]): {
prevItem == null
? null
: items.find((i) => i.id === prevItem.id) ?? null,
- [items]
+ [items],
);
const latestItems = useRef[]>(items);
@@ -80,15 +80,15 @@ export function useFullscreen(items: TileDescriptor[]): {
setFullscreenItem(
latestFullscreenItem.current === null
? latestItems.current.find((i) => i.id === itemId) ?? null
- : null
+ : null,
);
},
- [setFullscreenItem]
+ [setFullscreenItem],
);
const exitFullscreenCallback = useCallback(
() => setFullscreenItem(null),
- [setFullscreenItem]
+ [setFullscreenItem],
);
useLayoutEffect(() => {
@@ -103,7 +103,7 @@ export function useFullscreen(items: TileDescriptor[]): {
useFullscreenChange(
useCallback(() => {
if (!isFullscreen()) setFullscreenItem(null);
- }, [setFullscreenItem])
+ }, [setFullscreenItem]),
);
return {
diff --git a/src/room/useJoinRule.ts b/src/room/useJoinRule.ts
index 2fb854e7..798999e4 100644
--- a/src/room/useJoinRule.ts
+++ b/src/room/useJoinRule.ts
@@ -23,6 +23,6 @@ import { useRoomState } from "./useRoomState";
export function useJoinRule(room: Room): JoinRule {
return useRoomState(
room,
- useCallback((state) => state.getJoinRule(), [])
+ useCallback((state) => state.getJoinRule(), []),
);
}
diff --git a/src/room/useLoadGroupCall.ts b/src/room/useLoadGroupCall.ts
index ec9e1d94..423706ec 100644
--- a/src/room/useLoadGroupCall.ts
+++ b/src/room/useLoadGroupCall.ts
@@ -52,7 +52,7 @@ export interface GroupCallLoadState {
export const useLoadGroupCall = (
client: MatrixClient,
roomIdOrAlias: string,
- viaServers: string[]
+ viaServers: string[],
): GroupCallStatus => {
const { t } = useTranslation();
const [state, setState] = useState({ kind: "loading" });
@@ -70,7 +70,7 @@ export const useLoadGroupCall = (
// join anyway but the js-sdk recreates the room if you pass the alias for a
// room you're already joined to (which it probably ought not to).
const lookupResult = await client.getRoomIdForAlias(
- roomIdOrAlias.toLowerCase()
+ roomIdOrAlias.toLowerCase(),
);
logger.info(`${roomIdOrAlias} resolved to ${lookupResult.room_id}`);
room = client.getRoom(lookupResult.room_id);
@@ -81,7 +81,7 @@ export const useLoadGroupCall = (
});
} else {
logger.info(
- `Already in room ${lookupResult.room_id}, not rejoining.`
+ `Already in room ${lookupResult.room_id}, not rejoining.`,
);
}
} else {
@@ -92,7 +92,7 @@ export const useLoadGroupCall = (
}
logger.info(
- `Joined ${roomIdOrAlias}, waiting room to be ready for group calls`
+ `Joined ${roomIdOrAlias}, waiting room to be ready for group calls`,
);
await client.waitUntilRoomReadyForGroupCalls(room.roomId);
logger.info(`${roomIdOrAlias}, is ready for group calls`);
@@ -110,7 +110,7 @@ export const useLoadGroupCall = (
const waitForClientSyncing = async (): Promise => {
if (client.getSyncState() !== SyncState.Syncing) {
logger.debug(
- "useLoadGroupCall: waiting for client to start syncing..."
+ "useLoadGroupCall: waiting for client to start syncing...",
);
await new Promise((resolve) => {
const onSync = (): void => {
diff --git a/src/room/useRoomAvatar.ts b/src/room/useRoomAvatar.ts
index 8eb31b20..b00597e7 100644
--- a/src/room/useRoomAvatar.ts
+++ b/src/room/useRoomAvatar.ts
@@ -22,6 +22,6 @@ import { useRoomState } from "./useRoomState";
export function useRoomAvatar(room: Room): string | null {
return useRoomState(
room,
- useCallback(() => room.getMxcAvatarUrl(), [room])
+ useCallback(() => room.getMxcAvatarUrl(), [room]),
);
}
diff --git a/src/room/useRoomState.ts b/src/room/useRoomState.ts
index 2fa4d0b7..6e069b67 100644
--- a/src/room/useRoomState.ts
+++ b/src/room/useRoomState.ts
@@ -31,7 +31,7 @@ export const useRoomState = (room: Room, f: (state: RoomState) => T): T => {
useTypedEventEmitter(
room,
RoomStateEvent.Update,
- useCallback(() => setNumUpdates((n) => n + 1), [setNumUpdates])
+ useCallback(() => setNumUpdates((n) => n + 1), [setNumUpdates]),
);
// We want any change to the update counter to trigger an update here
// eslint-disable-next-line react-hooks/exhaustive-deps
diff --git a/src/rtcSessionHelpers.ts b/src/rtcSessionHelpers.ts
index 8d8053fd..1ea00160 100644
--- a/src/rtcSessionHelpers.ts
+++ b/src/rtcSessionHelpers.ts
@@ -48,7 +48,7 @@ export function enterRTCSession(rtcSession: MatrixRTCSession): void {
}
export async function leaveRTCSession(
- rtcSession: MatrixRTCSession
+ rtcSession: MatrixRTCSession,
): Promise {
//groupCallOTelMembership?.onLeaveCall();
await rtcSession.leaveRoomSession();
diff --git a/src/settings/FeedbackSettingsTab.tsx b/src/settings/FeedbackSettingsTab.tsx
index 6fda0194..af45b42c 100644
--- a/src/settings/FeedbackSettingsTab.tsx
+++ b/src/settings/FeedbackSettingsTab.tsx
@@ -57,7 +57,7 @@ export const FeedbackSettingsTab: FC = ({ roomId }) => {
sendRageshakeRequest(roomId, rageshakeRequestId);
}
},
- [submitRageshake, roomId, sendRageshakeRequest]
+ [submitRageshake, roomId, sendRageshakeRequest],
);
return (
@@ -65,7 +65,7 @@ export const FeedbackSettingsTab: FC = ({ roomId }) => {
{t("Submit feedback")}
{t(
- "If you are experiencing issues or simply would like to provide some feedback, please send us a short description below."
+ "If you are experiencing issues or simply would like to provide some feedback, please send us a short description below.",
)}