<commit_before>import { selectAllSequences } from "../resources/selectors";
import { store } from "../redux/store";
import { urlFriendly, lastUrlChunk } from "../util";
import { selectSequence } from "./actions";

export function setActiveSequenceByName(_ = "") {
  const sequences =
    selectAllSequences(store.getState().resources.index);
  const chunk = lastUrlChunk();
  if (chunk == "sequences") {
    return;
  }
  sequences.map(seq => {
    const name = urlFriendly(seq.body.name);
    const isMatch = (chunk === name);
    if (isMatch) {
      console.log("FOUND A MATCH!");
      setTimeout(() => store.dispatch(selectSequence(seq.uuid)), 2000);
    }
  });
}
<commit_msg>Seems to work- will a shorter timeout also work?<commit_after>import { selectAllSequences } from "../resources/selectors";
import { store } from "../redux/store";
import { urlFriendly, lastUrlChunk } from "../util";
import { selectSequence } from "./actions";

export function setActiveSequenceByName(_ = "") {
  const sequences =
    selectAllSequences(store.getState().resources.index);
  const chunk = lastUrlChunk();
  if (chunk == "sequences") {
    return;
  }
  sequences.map(seq => {
    const name = urlFriendly(seq.body.name);
    const isMatch = (chunk === name);
    if (isMatch) {
      console.log("FOUND A MATCH!");
      setTimeout(() => store.dispatch(selectSequence(seq.uuid)), 200);
    }
  });
}

{'fraction_non_alphanumeric': 0.16165951359084407, 'fraction_numerical': 0.005007153075822604, 'mean_word_length': 3.7263513513513513, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '522632', 'n_tokens_mistral': 421, 'n_tokens_neox': 415, 'n_words': 100}