<commit_before>import * as React from "react";
import * as classNames from "classnames";
import { connect, I18nProps } from "../connect";

import { IModalWidgetProps, ModalWidgetDiv } from "./modal-widget";

import partitionForUser from "../../util/partition-for-user";
import * as humanize from "humanize-plus";

import LoadingCircle from "../basics/loading-circle";

import * as electron from "electron";

export class ClearBrowsingData extends React.PureComponent<
  IProps & IDerivedProps & I18nProps,
  IState
> {
  constructor() {
    super();
    this.state = {
      fetchedCacheSize: false,
      clearCache: true,
      clearCookies: false,
    };
  }

  componentDidMount() {
    const { userId } = this.props;

    // FIXME: surely we can do that without remote ?
    const ourSession = electron.remote.session.fromPartition(
      partitionForUser(String(userId)),<commit_msg>Add note about downloads in clear browsing data code<commit_after>import * as React from "react";
import * as classNames from "classnames";
import { connect, I18nProps } from "../connect";

import { IModalWidgetProps, ModalWidgetDiv } from "./modal-widget";

import partitionForUser from "../../util/partition-for-user";
import * as humanize from "humanize-plus";

import LoadingCircle from "../basics/loading-circle";

import * as electron from "electron";

// TODO: So maybe this is a good place to clear downloads too
// I dunno, just a though. Like technically they shouldn't even
// stay long (should be cleaned up after install etc.)
// but yeah.

export class ClearBrowsingData extends React.PureComponent<
  IProps & IDerivedProps & I18nProps,
  IState
> {
  constructor() {
    super();
    this.state = {
      fetchedCacheSize: false,
      clearCache: true,
      clearCookies: false,
    };
  }

  componentDidMount() {
    const { userId } = this.props;

    // FIXME: surely we can do that without remote ?
    // more surely: that surely should just be done in metal
    // and we should read from store or something
    const ourSession = electron.remote.session.fromPartition(
      partitionForUser(String(userId)),
{'fraction_non_alphanumeric': 0.10880829015544041, 'fraction_numerical': 0.0037682524729156855, 'mean_word_length': 3.5384615384615383, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3744576', 'n_tokens_mistral': 612, 'n_tokens_neox': 601, 'n_words': 202}