diff --git a/src/client/initMatrix.ts b/src/client/initMatrix.ts index 030160a6..912fb7dd 100644 --- a/src/client/initMatrix.ts +++ b/src/client/initMatrix.ts @@ -102,7 +102,13 @@ export const logoutClient = async (mx: MatrixClient) => { } await mx.clearStores(); window.localStorage.clear(); - window.location.reload(); + // Navigate to root instead of reload(): on Android Capacitor the + // WebViewLocalServer fails to SPA-fallback on URLs with `%3A` in path + // segments (Matrix room/space ids), so reload of `///` + // or `/channels//...` returns ERR_HTTP_RESPONSE_CODE_FAILURE. + // Replacing to `/` always resolves to index.html; the Router index + // loader then redirects to the login page since the session is gone. + window.location.replace('/'); }; export const clearLoginData = async () => {