Remove unused javascript (#2470)
This commit is contained in:
parent
399b1a373e
commit
90ca8ca2c5
214 changed files with 341 additions and 8768 deletions
|
|
@ -4,13 +4,13 @@ import { useEffect } from 'react';
|
|||
import { useNavigate } from 'react-router-dom';
|
||||
import { ClientConfig, clientAllowedServer } from '../../../hooks/useClientConfig';
|
||||
import { autoDiscovery, specVersions } from '../../../cs-api';
|
||||
import { updateLocalStore } from '../../../../client/action/auth';
|
||||
import { ErrorCode } from '../../../cs-errorcode';
|
||||
import {
|
||||
deleteAfterLoginRedirectPath,
|
||||
getAfterLoginRedirectPath,
|
||||
} from '../../afterLoginRedirectPath';
|
||||
import { getHomePath } from '../../pathUtils';
|
||||
import { setFallbackSession } from '../../../state/sessions';
|
||||
|
||||
export enum GetBaseUrlError {
|
||||
NotAllow = 'NotAllow',
|
||||
|
|
@ -114,7 +114,7 @@ export const useLoginComplete = (data?: CustomLoginResponse) => {
|
|||
useEffect(() => {
|
||||
if (data) {
|
||||
const { response: loginRes, baseUrl: loginBaseUrl } = data;
|
||||
updateLocalStore(loginRes.access_token, loginRes.device_id, loginRes.user_id, loginBaseUrl);
|
||||
setFallbackSession(loginRes.access_token, loginRes.device_id, loginRes.user_id, loginBaseUrl);
|
||||
const afterLoginRedirectUrl = getAfterLoginRedirectPath();
|
||||
deleteAfterLoginRedirectPath();
|
||||
navigate(afterLoginRedirectUrl ?? getHomePath(), { replace: true });
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import {
|
|||
} from 'matrix-js-sdk';
|
||||
import { useEffect } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { updateLocalStore } from '../../../../client/action/auth';
|
||||
import { LoginPathSearchParams } from '../../paths';
|
||||
import { ErrorCode } from '../../../cs-errorcode';
|
||||
import {
|
||||
|
|
@ -17,6 +16,7 @@ import {
|
|||
} from '../../afterLoginRedirectPath';
|
||||
import { getHomePath, getLoginPath, withSearchParam } from '../../pathUtils';
|
||||
import { getMxIdLocalPart, getMxIdServer } from '../../../utils/matrix';
|
||||
import { setFallbackSession } from '../../../state/sessions';
|
||||
|
||||
export enum RegisterError {
|
||||
UserTaken = 'UserTaken',
|
||||
|
|
@ -119,7 +119,7 @@ export const useRegisterComplete = (data?: CustomRegisterResponse) => {
|
|||
const deviceId = response.device_id;
|
||||
|
||||
if (accessToken && deviceId) {
|
||||
updateLocalStore(accessToken, deviceId, userId, baseUrl);
|
||||
setFallbackSession(accessToken, deviceId, userId, baseUrl);
|
||||
const afterLoginRedirectPath = getAfterLoginRedirectPath();
|
||||
deleteAfterLoginRedirectPath();
|
||||
navigate(afterLoginRedirectPath ?? getHomePath(), { replace: true });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue