Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Change labs label back to Labs
Browse files Browse the repository at this point in the history
Signed-off-by: Šimon Brandner <[email protected]>
  • Loading branch information
SimonBrandner committed Oct 20, 2022
1 parent 1201b39 commit 3bd9d0b
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions src/components/views/dialogs/UserSettingsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import NotificationUserSettingsTab from "../settings/tabs/user/NotificationUserS
import PreferencesUserSettingsTab from "../settings/tabs/user/PreferencesUserSettingsTab";
import VoiceUserSettingsTab from "../settings/tabs/user/VoiceUserSettingsTab";
import HelpUserSettingsTab from "../settings/tabs/user/HelpUserSettingsTab";
import SdkConfig from "../../../SdkConfig";
import MjolnirUserSettingsTab from "../settings/tabs/user/MjolnirUserSettingsTab";
import { UIFeature } from "../../../settings/UIFeature";
import BaseDialog from "./BaseDialog";
Expand All @@ -37,20 +36,7 @@ import SidebarUserSettingsTab from "../settings/tabs/user/SidebarUserSettingsTab
import KeyboardUserSettingsTab from "../settings/tabs/user/KeyboardUserSettingsTab";
import SessionManagerTab from '../settings/tabs/user/SessionManagerTab';
import { UserTab } from "./UserTab";

/**
* Returns null if labs are disabled and no betas exist
*/
const getLabsTabLabel = (): string | null => {
const showLabs = SdkConfig.get("show_labs_settings");
const showBetas = SettingsStore.getFeatureSettingNames().some(k => SettingsStore.getBetaInfo(k));

if (showBetas && showLabs) return _td("Betas & Labs");
else if (showBetas) return _td("Betas");
else if (showLabs) return _td("Labs");

return null;
};
import SdkConfig from "../../../SdkConfig";

interface IProps extends IDialogProps {
initialTabId?: UserTab;
Expand Down Expand Up @@ -165,10 +151,13 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
undefined,
));
}
if (getLabsTabLabel()) {
if (
SdkConfig.get("show_labs_settings")
|| SettingsStore.getFeatureSettingNames().some(k => SettingsStore.getBetaInfo(k))
) {
tabs.push(new Tab(
UserTab.Labs,
getLabsTabLabel(),
_td("Labs"),
"mx_UserSettingsDialog_labsIcon",
<LabsUserSettingsTab />,
"UserSettingsLabs",
Expand Down

0 comments on commit 3bd9d0b

Please sign in to comment.