<commit_before>import {navigateAction} from 'fluxible-router';
import UserProfileStore from '../stores/UserProfileStore';
export default function loadAddDeck(context, payload, done) {
    //redirect to homepage if not logged in
    let store = context.getStore(UserProfileStore);
    if (!((store.username !== undefined && store.username !== null && store.username !== '')
      && (store.userid !== undefined && store.userid !== null && store.userid !== '')
      && (store.jwt !== undefined && store.jwt !== null && store.jwt !== ''))) {
        context.executeAction(navigateAction, {
            url: '/'
        });
    }
    done();
}<commit_msg>[SWIK-501_redirect_on_add_deck] Now Login modal opens if addDeck was accessed by a not logged in user<commit_after>import {navigateAction} from 'fluxible-router';
import UserProfileStore from '../stores/UserProfileStore';
export default function loadAddDeck(context, payload, done) {
    //redirect to homepage if not logged in
    let store = context.getStore(UserProfileStore);
    if (!((store.username !== undefined && store.username !== null && store.username !== '')
      && (store.userid !== undefined && store.userid !== null && store.userid !== '')
      && (store.jwt !== undefined && store.jwt !== null && store.jwt !== ''))) {
        context.executeAction(navigateAction, {
            url: '/'
        });
        context.dispatch('TOGGLE_LOGIN_MODAL', null);
    }
    done();
}
{'fraction_non_alphanumeric': 0.16459197786998617, 'fraction_numerical': 0.002074688796680498, 'mean_word_length': 3.4523076923076923, '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': '5965290', 'n_tokens_mistral': 409, 'n_tokens_neox': 399, 'n_words': 102}