Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NcjTemplateService issues when templates not loaded #1390

Closed
ascobie opened this issue May 29, 2018 · 0 comments · Fixed by #1599
Closed

NcjTemplateService issues when templates not loaded #1390

ascobie opened this issue May 29, 2018 · 0 comments · Fixed by #1599

Comments

@ascobie
Copy link
Member

ascobie commented May 29, 2018

This is a funny one and is hard to replicate as it normally happens only the fist time i launch the app from a plugin URL first thing in the morning.

Seems that the templates are cleared out and the call to NcjTemplateService.getApplication fails with the error: "Cannot read property 'filter' of undefined". Seems to point to this:

    getApplication(applicationId) {
        return this.get("index.json").map((apps) => {
            const data = **apps.filter**(app => app.id === applicationId).first();
            return data && new models_1.Application(Object.assign({}, data, { icon: this.getApplicationIcon(data.id), readme: this.getApplicationReadme(data.id) }));
        }).share();
    }

apps must return null and the call to filter fails.

Might be that there is a period of time between when the templates get cleared and refreshed where there are no templates for this query to call on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants