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
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) => {