Don't kill other sessions when running as a widget

This commit is contained in:
Robin Townsend 2022-09-12 15:37:39 -04:00
parent 3bffe58549
commit fd18f2acdf
2 changed files with 5 additions and 2 deletions

View file

@ -258,7 +258,11 @@ export const ClientProvider: FC<Props> = ({ children }) => {
}, [history]);
useEffect(() => {
if (client) {
// To protect against multiple sessions writing to the same storage
// simultaneously, we send a to-device message that shuts down all other
// running instances of the app. This isn't necessary if the app is running
// in a widget though, since then it'll be mostly stateless.
if (!widget && client) {
const loadTime = Date.now();
const onToDeviceEvent = (event: MatrixEvent) => {

View file

@ -106,7 +106,6 @@ export const widget: WidgetHelpers | null = (() => {
EventType.CallSDPStreamMetadataChanged,
EventType.CallSDPStreamMetadataChangedPrefix,
EventType.CallReplaces,
"org.matrix.call_duplicate_session",
];
const client = createRoomWidgetClient(