<commit_before>import Ember from 'ember';
import setWindowTitle from '../utils/set-window-title';
import setDockMenu from '../utils/set-dock-menu';
import setUsertasks from '../utils/set-user-tasks';
import getCurrentWindow from '../utils/get-current-window';

const {Component} = Ember;

export default Component.extend({
    store: Ember.inject.service(),
    autoUpdate: Ember.inject.service(),
    classNames: ['gh-app'],
    isFindInViewActive: false,
    isMac: !!(process.platform === 'darwin'),

    didReceiveAttrs() {
        this.setup();
        this.createSingleInstance();
        this.get('autoUpdate').checkForUpdates();
    },

    /**
     * Boolean value that returns true if there are any blogs
     */
    hasBlogs: Ember.computed('blogs', function () {
        let b = this.get('blogs');
        return (b && b.content && b.content.length && b.content.length > 0);
    }),

    /**
     * Setup method, determining which blog to display.
     */
    setup() {
        if (this.get('hasBlogs')) {
            this.send('switchToBlog', this.findSelectedBlog() || this.get('blogs.firstObject'));
            this.createMenus();
        } else {
            this.set('isEditBlogVisible', true);
        }
    },

    /**
     * Ensures Ghost runs as a single instance.
     */
    createSingleInstance() {<commit_msg>:wrench: Ensure ‘Add Blog’ is shown if blogs = 0<commit_after>import Ember from 'ember';
import setWindowTitle from '../utils/set-window-title';
import setDockMenu from '../utils/set-dock-menu';
import setUsertasks from '../utils/set-user-tasks';
import getCurrentWindow from '../utils/get-current-window';

const {Component} = Ember;

export default Component.extend({
    store: Ember.inject.service(),
    autoUpdate: Ember.inject.service(),
    classNames: ['gh-app'],
    isFindInViewActive: false,
    isMac: !!(process.platform === 'darwin'),

    didReceiveAttrs() {
        this.setup();
        this.createSingleInstance();
        this.get('autoUpdate').checkForUpdates();
    },

    /**
     * Boolean value that returns true if there are any blogs
     */
    hasBlogs: Ember.computed('blogs', function () {
        let b = this.get('blogs');
        return (b && b.content && b.content.length && b.content.length > 0);
    }),

    blogsObserver: Ember.observer('hasBlogs', function () {
        if (!this.get('hasBlogs')) {
            this.send('showAddBlog');
        }
    }),

    /**
     * Setup method, determining which blog to display.
     */
    setup() {
        if (this.get('hasBlogs')) {
            this.send('switchToBlog', this.findSelectedBlog() || this.get('blogs.firstObject'));
            this.createMenus();
        } else {
            this.set('isEditBlogVisible', true);
        }
    },

    /**
     * Ensures Ghost runs as a single instance.
     */
    createSingleInstance() {
{'fraction_non_alphanumeric': 0.15634837355718784, 'fraction_numerical': 0.001049317943336831, 'mean_word_length': 2.579474342928661, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4642071', 'n_tokens_mistral': 860, 'n_tokens_neox': 830, 'n_words': 190}