<commit_before>angular.module(PKG.name + '.feature.flows')
  .controller('FlowsDetailController', function($scope, $state) {
    if (!$state.params.runId) {
      $state.go('flows.detail.runs');
    }
  });<commit_msg>Fixes flow detail controller for different navigation scenarios<commit_after>angular.module(PKG.name + '.feature.flows')
  .controller('FlowsDetailController', function($scope, $state, $timeout) {
    if ($state.includes('**.runs.**')) {
      // If going to flow detail run tab don't do anything.
      // ui-router already has everything to load the state.
      return;
    } else if (!$state.params.runId && $state.includes('flows.detail.*')) {
      // If going to any state other than run tab just proceed.
      $timeout(function() {
        $state.go($state.current);
      });
    } else {
      // If coming from paren default to the run tab.
      $timeout(function() {
        $state.go('flows.detail.runs');
      })
    }
});
{'fraction_non_alphanumeric': 0.16091954022988506, 'fraction_numerical': 0.0, 'mean_word_length': 2.9916666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6531346', 'n_tokens_mistral': 287, 'n_tokens_neox': 287, 'n_words': 71}