<commit_before>angular.module('proxtop').controller('LoginController', ['$scope', 'settings', 'ipc', '$state', '$mdToast', '$rootScope', function($scope, settings, ipc, $state, $mdToast, $rootScope) {
    var loggedIn = false;
    ipc.on('login', function(ev, result) {
        if(result.success) {
            loggedIn = true;
            console.log('LOGGED IN');
            $state.go('profile');
        } else {
            console.log('COULD NOT LOGIN - ' + result.reason);
            $mdToast.show($mdToast.simple().textContent('Could not login: ' + result.reason));
        }
    });

    $rootScope.$on('$stateChangeStart', function(event, toState) {
        if (toState.name !== 'login' && !loggedIn) {
            event.preventDefault();
            $state.go('login');<commit_msg>Fix not loading watchlist after initial login. Closes #59.<commit_after>angular.module('proxtop').controller('LoginController', ['$scope', 'settings', 'ipc', '$state', '$mdToast', '$rootScope', function($scope, settings, ipc, $state, $mdToast, $rootScope) {
    var loggedIn = false;
    ipc.on('login', function(ev, result) {
        if(result.success) {
            loggedIn = true;
            console.log('LOGGED IN');
            ipc.send('watchlist-update');
            $state.go('profile');
        } else {
            console.log('COULD NOT LOGIN - ' + result.reason);
            $mdToast.show($mdToast.simple().textContent('Could not login: ' + result.reason));
        }
    });

    $rootScope.$on('$stateChangeStart', function(event, toState) {
        if (toState.name !== 'login' && !loggedIn) {
            event.preventDefault();
            $state.go('login');
{'fraction_non_alphanumeric': 0.17931858936043035, 'fraction_numerical': 0.001195457262402869, 'mean_word_length': 2.7533632286995515, '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': '6866275', 'n_tokens_mistral': 506, 'n_tokens_neox': 504, 'n_words': 94}