mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-05 19:59:20 +00:00
linting
This commit is contained in:
@@ -24,14 +24,14 @@ import {
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { logger } from "matrix-js-sdk/src/logger";
|
import { logger } from "matrix-js-sdk/src/logger";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
|
import { useObservableState } from "observable-hooks";
|
||||||
|
import { map } from "rxjs";
|
||||||
|
|
||||||
import { useReactions } from "../useReactions";
|
import { useReactions } from "../useReactions";
|
||||||
import styles from "./ReactionToggleButton.module.css";
|
import styles from "./ReactionToggleButton.module.css";
|
||||||
import { ReactionOption, ReactionSet, ReactionsRowSize } from "../reactions";
|
import { ReactionOption, ReactionSet, ReactionsRowSize } from "../reactions";
|
||||||
import { Modal } from "../Modal";
|
import { Modal } from "../Modal";
|
||||||
import { CallViewModel } from "../state/CallViewModel";
|
import { CallViewModel } from "../state/CallViewModel";
|
||||||
import { useObservableState } from "observable-hooks";
|
|
||||||
import { map } from "rxjs";
|
|
||||||
|
|
||||||
interface InnerButtonProps extends ComponentPropsWithoutRef<"button"> {
|
interface InnerButtonProps extends ComponentPropsWithoutRef<"button"> {
|
||||||
raised: boolean;
|
raised: boolean;
|
||||||
|
|||||||
@@ -6,9 +6,10 @@ Please see LICENSE in the repository root for full details.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ReactNode } from "react";
|
import { ReactNode } from "react";
|
||||||
|
import { useObservableState } from "observable-hooks";
|
||||||
|
|
||||||
import styles from "./ReactionsOverlay.module.css";
|
import styles from "./ReactionsOverlay.module.css";
|
||||||
import { CallViewModel } from "../state/CallViewModel";
|
import { CallViewModel } from "../state/CallViewModel";
|
||||||
import { useObservableState } from "observable-hooks";
|
|
||||||
|
|
||||||
export function ReactionsOverlay({ vm }: { vm: CallViewModel }): ReactNode {
|
export function ReactionsOverlay({ vm }: { vm: CallViewModel }): ReactNode {
|
||||||
const reactionsIcons = useObservableState(vm.visibleReactions);
|
const reactionsIcons = useObservableState(vm.visibleReactions);
|
||||||
|
|||||||
@@ -1117,12 +1117,17 @@ export class CallViewModel extends ViewModel {
|
|||||||
this.scope.state(),
|
this.scope.state(),
|
||||||
);
|
);
|
||||||
|
|
||||||
public readonly handsRaised = new Subject<Record<string, Date>>();
|
private readonly handsRaisedSubject = new Subject<Record<string, Date>>();
|
||||||
public readonly reactions = new Subject<Record<string, ReactionOption>>();
|
private readonly reactionsSubject = new Subject<
|
||||||
|
Record<string, ReactionOption>
|
||||||
|
>();
|
||||||
|
|
||||||
public updateReactions(data: ReturnType<typeof useReactions>) {
|
public readonly handRaised = this.handsRaisedSubject.asObservable();
|
||||||
this.handsRaised.next(data.raisedHands);
|
public readonly reactions = this.reactionsSubject.asObservable();
|
||||||
this.reactions.next(data.reactions);
|
|
||||||
|
public updateReactions(data: ReturnType<typeof useReactions>): void {
|
||||||
|
this.handsRaisedSubject.next(data.raisedHands);
|
||||||
|
this.reactionsSubject.next(data.reactions);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ export const ReactionsProvider = ({
|
|||||||
memberships.find(
|
memberships.find(
|
||||||
(m) => m.sender === myUserId && m.deviceId === myDeviceId,
|
(m) => m.sender === myUserId && m.deviceId === myDeviceId,
|
||||||
)?.eventId,
|
)?.eventId,
|
||||||
[memberships, myUserId],
|
[memberships, myUserId, myDeviceId],
|
||||||
);
|
);
|
||||||
const myMembershipIdentifier = useMemo(() => {
|
const myMembershipIdentifier = useMemo(() => {
|
||||||
const membership = memberships.find((m) => m.sender === myUserId);
|
const membership = memberships.find((m) => m.sender === myUserId);
|
||||||
|
|||||||
Reference in New Issue
Block a user