<commit_before>// ==UserScript==
// @name AuthStateListener
// @namespace auth
// @include http://klavogonki.ru/*
// ==/UserScript==

try {
    var link = document.querySelector('.user-dropdown .dropmenu a.btn');
    var userId = link ? link.href.match(/\d+/)[0] : null;
    kango.invokeAsync('KlavoTools.Auth.getState', function (state) {
        if (state.id !== userId) {
            if (userId) {
                kango.invokeAsync('KlavoTools.Auth.login');
            } else {
                kango.invokeAsync('KlavoTools.Auth.logout');
            }
        }
    });
} catch (err) {
    console.error('AuthStateListener content script failed: ' + err.toString());
}<commit_msg>(f) Fixed an error with typecasting<commit_after>// ==UserScript==
// @name AuthStateListener
// @namespace auth
// @include http://klavogonki.ru/*
// ==/UserScript==

try {
    var link = document.querySelector('.user-dropdown .dropmenu a.btn');
    var userId = link ? link.href.match(/\d+/)[0] * 1 : null;
    kango.invokeAsync('KlavoTools.Auth.getState', function (state) {
        if (state.id !== userId) {
            if (userId) {
                kango.invokeAsync('KlavoTools.Auth.login');
            } else {
                kango.invokeAsync('KlavoTools.Auth.logout');
            }
        }
    });
} catch (err) {
    console.error('AuthStateListener content script failed: ' + err.toString());
}
{'fraction_non_alphanumeric': 0.1683381088825215, 'fraction_numerical': 0.002148997134670487, 'mean_word_length': 2.3907766990291264, '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': '2346211', 'n_tokens_mistral': 437, 'n_tokens_neox': 432, 'n_words': 82}