Release Sign in with QR out of labs (#10066)

This commit is contained in:
Hugh Nimmo-Smith 2023-02-16 09:18:12 +00:00 committed by GitHub
parent 477de46814
commit 5123d7e641
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 12 additions and 66 deletions

View file

@ -20,7 +20,6 @@ import type { IServerVersions } from "matrix-js-sdk/src/matrix";
import { _t } from "../../../../languageHandler";
import AccessibleButton from "../../elements/AccessibleButton";
import SettingsSubsection from "../shared/SettingsSubsection";
import SettingsStore from "../../../../settings/SettingsStore";
interface IProps {
onShowQr: () => void;
@ -33,12 +32,10 @@ export default class LoginWithQRSection extends React.Component<IProps> {
}
public render(): JSX.Element | null {
// Needs server support for MSC3882 and MSC3886:
const msc3882Supported = !!this.props.versions?.unstable_features?.["org.matrix.msc3882"];
const msc3886Supported = !!this.props.versions?.unstable_features?.["org.matrix.msc3886"];
// Needs to be enabled as a feature + server support MSC3886 or have a default rendezvous server configured:
const offerShowQr =
SettingsStore.getValue("feature_qr_signin_reciprocate_show") && msc3882Supported && msc3886Supported; // We don't support configuration of a fallback at the moment so we just check the MSCs
const offerShowQr = msc3882Supported && msc3886Supported;
// don't show anything if no method is available
if (!offerShowQr) {

View file

@ -381,7 +381,6 @@ export default class SecurityUserSettingsTab extends React.Component<IProps, ISt
}
const useNewSessionManager = SettingsStore.getValue("feature_new_device_manager");
const showQrCodeEnabled = SettingsStore.getValue("feature_qr_signin_reciprocate_show");
const devicesSection = useNewSessionManager ? null : (
<>
<div className="mx_SettingsTab_heading">{_t("Where you're signed in")}</div>
@ -394,15 +393,13 @@ export default class SecurityUserSettingsTab extends React.Component<IProps, ISt
</span>
<DevicesPanel />
</div>
{showQrCodeEnabled ? (
<LoginWithQRSection onShowQr={this.onShowQRClicked} versions={this.state.versions} />
) : null}
<LoginWithQRSection onShowQr={this.onShowQRClicked} versions={this.state.versions} />
</>
);
const client = MatrixClientPeg.get();
if (showQrCodeEnabled && this.state.showLoginWithQR) {
if (this.state.showLoginWithQR) {
return (
<div className="mx_SettingsTab mx_SecurityUserSettingsTab">
<LoginWithQR

View file

@ -34,7 +34,6 @@ import { deleteDevicesWithInteractiveAuth } from "../../devices/deleteDevices";
import SettingsTab from "../SettingsTab";
import LoginWithQRSection from "../../devices/LoginWithQRSection";
import LoginWithQR, { Mode } from "../../../auth/LoginWithQR";
import SettingsStore from "../../../../../settings/SettingsStore";
import { useAsyncMemo } from "../../../../../hooks/useAsyncMemo";
import QuestionDialog from "../../../dialogs/QuestionDialog";
import { FilterVariation } from "../../devices/filter";
@ -212,8 +211,6 @@ const SessionManagerTab: React.FC = () => {
const [signInWithQrMode, setSignInWithQrMode] = useState<Mode | null>();
const showQrCodeEnabled = SettingsStore.getValue("feature_qr_signin_reciprocate_show");
const onQrFinish = useCallback(() => {
setSignInWithQrMode(null);
}, [setSignInWithQrMode]);
@ -222,7 +219,7 @@ const SessionManagerTab: React.FC = () => {
setSignInWithQrMode(Mode.Show);
}, [setSignInWithQrMode]);
if (showQrCodeEnabled && signInWithQrMode) {
if (signInWithQrMode) {
return <LoginWithQR mode={signInWithQrMode} onFinished={onQrFinish} client={matrixClient} />;
}
@ -282,7 +279,7 @@ const SessionManagerTab: React.FC = () => {
/>
</SettingsSubsection>
)}
{showQrCodeEnabled ? <LoginWithQRSection onShowQr={onShowQrClicked} versions={clientVersions} /> : null}
<LoginWithQRSection onShowQr={onShowQrClicked} versions={clientVersions} />
</SettingsTab>
);
};