Skip to content

Commit

Permalink
cleanup from review 1
Browse files Browse the repository at this point in the history
  • Loading branch information
epixa committed Feb 4, 2018
1 parent 33bfdfe commit d271851
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
1 change: 0 additions & 1 deletion src/dev/jest/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"rootDir": "../../..",
"roots": [
"<rootDir>/src/ui",
"<rootDir>/src/ui/public",
"<rootDir>/src/core_plugins",
"<rootDir>/ui_framework/",
"<rootDir>/packages"
Expand Down
9 changes: 2 additions & 7 deletions src/ui/ui_render/bootstrap/app_bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,9 @@ export class AppBootstrap {
}

async getJsFileHash() {
if (!this._rawTemplate) {
this._rawTemplate = await loadRawTemplate();
}

const fileContents = await this.getJsFile();
const hash = createHash('sha1');
hash.update(this._rawTemplate);
hash.update(JSON.stringify(this.templateData));
hash.update(JSON.stringify(this.translations));
hash.update(fileContents);
return hash.digest('hex');
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/ui/ui_render/ui_render_mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ export function uiRenderMixin(kbnServer, server, config) {
path: '/bundles/app/{id}/bootstrap.js',
method: 'GET',
async handler(request, reply) {
const { id } = request.params;
const app = server.getUiAppById(id);
if (!app) {
return reply(Boom.notFound(`Unknown app: ${id}`));
}

try {
const { id } = request.params;
const app = server.getUiAppById(id);
if (!app) {
throw Boom.notFound(`Unknown app: ${id}`);
}

const bootstrap = new AppBootstrap({
templateData: {
appId: app.getId(),
Expand Down

0 comments on commit d271851

Please sign in to comment.