<commit_before>import Ember from 'ember';
import ajax from 'ic-ajax';

export default Ember.Route.extend({

    model(params) {
        const requestedVersion = params.version_num === 'all' ? '' : params.version_num;

        const crate = this.modelFor('crate');
        const controller = this.controllerFor(this.routeName);
        const maxVersion = crate.get('max_version');

        const isUnstableVersion = version => {
            const versionLen = version.length;
            let majorMinorPatchChars = 0;
            let result = false;

            for (let i = 0; i < versionLen; i++) {
                const char = version.charAt(i);

                if (!isNaN(parseInt(char)) || char === '.') {
                    majorMinorPatchChars++;
                } else {
                    break;
                }
            }

            if (versionLen !== majorMinorPatchChars) {
                result = true;
            }

            return result;
        };<commit_msg>Fix the infinite spinner on the follow button<commit_after>import Ember from 'ember';
import ajax from 'ic-ajax';

export default Ember.Route.extend({
    refreshAfterLogin: Ember.observer('session.isLoggedIn', function() {
        this.refresh();
    }),

    model(params) {
        const requestedVersion = params.version_num === 'all' ? '' : params.version_num;

        const crate = this.modelFor('crate');
        const controller = this.controllerFor(this.routeName);
        const maxVersion = crate.get('max_version');

        const isUnstableVersion = version => {
            const versionLen = version.length;
            let majorMinorPatchChars = 0;
            let result = false;

            for (let i = 0; i < versionLen; i++) {
                const char = version.charAt(i);

                if (!isNaN(parseInt(char)) || char === '.') {
                    majorMinorPatchChars++;
                } else {
                    break;
                }
            }

            if (versionLen !== majorMinorPatchChars) {
                result = true;
            }

            return result;
        };
{'fraction_non_alphanumeric': 0.11278905143935819, 'fraction_numerical': 0.0018876828692779614, 'mean_word_length': 1.6733921815889028, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2615239', 'n_tokens_mistral': 572, 'n_tokens_neox': 536, 'n_words': 133}