<commit_before>import { Formik } from "formik";
import _ = require("lodash");
import * as React from "react";
import { AccountClient } from "../../Account/AccountClient";
import { Tabs } from "../../Components/Tabs";
import { Libraries } from "../../Library/Libraries";
import { Settings } from "../Settings";
import { About } from "./About";
import { AccountSettings } from "./AccountSettings";
import { EpicInitiativeSettings } from "./EpicInitiativeSettings";
import { OptionsSettings } from "./OptionsSettings";

enum SettingsTab {
  About = "About",
  Commands = "Commands",
  Options = "Options",
  Account = "Account",
  EpicInitiative = "Epic Initiative"
}

const SettingsTabOptions = _.values<typeof SettingsTab>(SettingsTab);

interface SettingsPaneProps {
  repeatTutorial: () => void;
  reviewPrivacyPolicy: () => void;
  accountClient: AccountClient;
  libraries: Libraries;
  settings: Settings;
  handleNewSettings: (newSettings: Settings) => void;
  saveAndClose: () => void;
}
interface SettingsPaneState {
  currentTab: SettingsTab;
}

export class SettingsPane extends React.Component<
  SettingsPaneProps,
  SettingsPaneState
> {
  constructor(props) {
    super(props);
    this.state = {
      currentTab: SettingsTab.About
    };
  }
<commit_msg>Remember selected tab when settings closes<commit_after>import { Formik } from "formik";
import _ = require("lodash");
import * as React from "react";
import { AccountClient } from "../../Account/AccountClient";
import { Tabs } from "../../Components/Tabs";
import { Libraries } from "../../Library/Libraries";
import { Settings } from "../Settings";
import { About } from "./About";
import { AccountSettings } from "./AccountSettings";
import { EpicInitiativeSettings } from "./EpicInitiativeSettings";
import { OptionsSettings } from "./OptionsSettings";

enum SettingsTab {
  About = "About",
  Commands = "Commands",
  Options = "Options",
  Account = "Account",
  EpicInitiative = "Epic Initiative"
}

const SettingsTabOptions = _.values<typeof SettingsTab>(SettingsTab);

interface SettingsPaneProps {
  repeatTutorial: () => void;
  reviewPrivacyPolicy: () => void;
  accountClient: AccountClient;
  libraries: Libraries;
  settings: Settings;
  handleNewSettings: (newSettings: Settings) => void;
  saveAndClose: () => void;
}
interface SettingsPaneState {
  currentTab: SettingsTab;
}

let lastTab: SettingsTab = SettingsTab.About;

export class SettingsPane extends React.Component<
  SettingsPaneProps,
  SettingsPaneState
> {
  constructor(props) {
    super(props);
    this.state = {
      currentTab: lastTab
    };
  }

  public componentDidUpdate = () => {
    lastTab = this.state.currentTab;
  };

{'fraction_non_alphanumeric': 0.13519553072625698, 'fraction_numerical': 0.0, 'mean_word_length': 4.382765531062124, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '966441', 'n_tokens_mistral': 754, 'n_tokens_neox': 752, 'n_words': 201}