mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-02 19:49:23 +00:00
do not use tap for important logic
This commit is contained in:
@@ -42,7 +42,7 @@ import { type MuteStates } from "../../MuteStates";
|
|||||||
import { type ProcessorState } from "../../../livekit/TrackProcessorContext";
|
import { type ProcessorState } from "../../../livekit/TrackProcessorContext";
|
||||||
import { type MediaDevices } from "../../MediaDevices";
|
import { type MediaDevices } from "../../MediaDevices";
|
||||||
import { and$ } from "../../../utils/observable";
|
import { and$ } from "../../../utils/observable";
|
||||||
import { type ElementCallError } from "../../../utils/errors";
|
import { type ElementCallError, UnknownCallError } from "../../../utils/errors";
|
||||||
import {
|
import {
|
||||||
ElementWidgetActions,
|
ElementWidgetActions,
|
||||||
widget,
|
widget,
|
||||||
@@ -487,19 +487,21 @@ export const createLocalMembership$ = ({
|
|||||||
switchMap((c) =>
|
switchMap((c) =>
|
||||||
c === null ? of({ state: "Initialized" } as ConnectionState) : c.state$,
|
c === null ? of({ state: "Initialized" } as ConnectionState) : c.state$,
|
||||||
),
|
),
|
||||||
tap((s) => {
|
map((s) => {
|
||||||
logger.trace(`Local connection state update: ${s.state}`);
|
logger.trace(`Local connection state update: ${s.state}`);
|
||||||
if (s.state == "FailedToStart") {
|
if (s.state == "FailedToStart") {
|
||||||
configError$.next(s.error as ElementCallError);
|
return s.error instanceof ElementCallError
|
||||||
|
? s.error
|
||||||
|
: new UnknownCallError(s.error);
|
||||||
} else {
|
} else {
|
||||||
// TODO do we need to clear errors on other states?
|
return null;
|
||||||
// It is a fatal error so the user needs to reload or similar anyway.
|
|
||||||
configError$.next(null);
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
scope.bind(),
|
scope.bind(),
|
||||||
)
|
)
|
||||||
.subscribe();
|
.subscribe((fatalError) => {
|
||||||
|
configError$.next(fatalError);
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the user is currently sharing their screen.
|
* Whether the user is currently sharing their screen.
|
||||||
|
|||||||
Reference in New Issue
Block a user