<commit_before>'use strict';

angular.element(document).ready(function() {

  // Run copayApp after device is ready.
  var startAngular = function() {
    angular.bootstrap(document, ['copayApp']);
  };
  /* Cordova specific Init */
  if (window.cordova !== undefined) {

    document.addEventListener('deviceready', function() {

      document.addEventListener('pause', function() {
        if (!window.ignoreMobilePause) {
          window.location = '#/';
        }
      }, false);

      document.addEventListener('resume', function() {
        if (!window.ignoreMobilePause) {
          window.location = '#/cordova/resume';
        }
        setTimeout(function() {
          window.ignoreMobilePause = false;
        }, 100);
      }, false);

      // We are not emitting here, since when the BWS socket reconnects,
      // update will be triggered  
      document.addEventListener('offline', function() {
        window.location = '#/cordova/offline';
      }, false);

      // Back button event
      document.addEventListener('backbutton', function() {
        var loc = window.location;
        if (loc.toString().match(/index\.html#\/$/)) {
          navigator.app.exitApp();
        }
        else {
          window.location = '#/walletHome';
        }
      }, false);

      document.addEventListener('menubutton', function() {
        window.location = '#/preferences';
      }, false);



      setTimeout(function() {
        navigator.splashscreen.hide();
      }, 2000);

      function handleBitcoinURI(url) {
        if (!url) return;
        setTimeout(function() {
          window.location = '#/uri-payment/' + url;
        }, 1000);
      }

      window.plugins.webintent.getUri(handleBitcoinURI);
      window.plugins.webintent.onNewIntent(handleBitcoinURI);
      window.handleOpenURL = handleBitcoinURI;

      startAngular();
    }, false);
  } else {
    startAngular();
  }
<commit_msg>Fix back button<commit_after>'use strict';

angular.element(document).ready(function() {

  // Run copayApp after device is ready.
  var startAngular = function() {
    angular.bootstrap(document, ['copayApp']);
  };
  /* Cordova specific Init */
  if (window.cordova !== undefined) {

    document.addEventListener('deviceready', function() {

      document.addEventListener('pause', function() {
        if (!window.ignoreMobilePause) {
          window.location = '#/';
        }
      }, false);

      document.addEventListener('resume', function() {
        if (!window.ignoreMobilePause) {
          window.location = '#/cordova/resume';
        }
        setTimeout(function() {
          window.ignoreMobilePause = false;
        }, 100);
      }, false);

      // We are not emitting here, since when the BWS socket reconnects,
      // update will be triggered  
      document.addEventListener('offline', function() {
        window.location = '#/cordova/offline';
      }, false);

      // Back button event
      document.addEventListener('backbutton', function() {
        var loc = window.location;
        if (loc.toString().match(/index\.html#\/$/)) {
          navigator.app.exitApp();
        }
        else {
          window.location = '#/cordova/walletHome';
        }
      }, false);

      document.addEventListener('menubutton', function() {
        window.location = '#/preferences';
      }, false);



      setTimeout(function() {
        navigator.splashscreen.hide();
      }, 2000);

      function handleBitcoinURI(url) {
        if (!url) return;
        setTimeout(function() {
          window.location = '#/uri-payment/' + url;
        }, 1000);
      }

      window.plugins.webintent.getUri(handleBitcoinURI);
      window.plugins.webintent.onNewIntent(handleBitcoinURI);
      window.handleOpenURL = handleBitcoinURI;

      startAngular();
    }, false);
  } else {
    startAngular();
  }

{'fraction_non_alphanumeric': 0.14215432418436044, 'fraction_numerical': 0.005696530295183843, 'mean_word_length': 2.3073630136986303, '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': '4373300', 'n_tokens_mistral': 1094, 'n_tokens_neox': 1047, 'n_words': 202}