<commit_before>import Ember from 'ember';

export default Ember.Service.extend({
    approute: null,
    promise: null,
    showing: false,
    routename: 'application',
    outletname: 'modal',

    setApplicationRoute(approute, routename='application', outletname='modal') {
        this.set('approute', approute);
        this.set('routename', routename);
        this.set('outletname', outletname);
    },

    show(template, model) {
        if(this.get('showing')) {
            console.log("There's already a modal displaying!");
            return;
        }
        this.set('showing', true);

        this.get('approute').render(template, {
            into: this.get('routename'),
            outlet: this.get('outletname'),
            model: model
        });
        let defer = Ember.RSVP.defer();
        this.set('defer', defer);
        return defer.promise;
    },
    close(res) {
        if(!this.get('showing')) {
            console.log('There is no modal to close!');
            return;
        }
        this.set('showing', false);
        this.get('approute').disconnectOutlet({
            outlet: this.get('outletname'),
            parentView: this.get('routename')
        });<commit_msg>eslint fixes<commit_after>import Ember from 'ember';

export default Ember.Service.extend({
    approute: null,
    promise: null,
    showing: false,
    routename: 'application',
    outletname: 'modal',

    setApplicationRoute(approute, routename='application', outletname='modal') {
        this.set('approute', approute);
        this.set('routename', routename);
        this.set('outletname', outletname);
    },

    show(template, model) {
        if(this.get('showing')) {
            console.log("There's already a modal displaying!");
            return null;
        }
        this.set('showing', true);

        this.get('approute').render(template, {
            into: this.get('routename'),
            outlet: this.get('outletname'),
            model: model
        });
        let defer = Ember.RSVP.defer();
        this.set('defer', defer);
        return defer.promise;
    },
    close(res) {
        if(!this.get('showing')) {
            console.log('There is no modal to close!');
            return;
        }
        this.set('showing', false);
        this.get('approute').disconnectOutlet({
            outlet: this.get('outletname'),
            parentView: this.get('routename')
        });
{'fraction_non_alphanumeric': 0.14987714987714987, 'fraction_numerical': 0.0, 'mean_word_length': 2.185136897001304, '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': '7184647', 'n_tokens_mistral': 725, 'n_tokens_neox': 701, 'n_words': 136}