From a37e97a568e160848d6d145271a95e502fc7d340 Mon Sep 17 00:00:00 2001 From: Bill Riehl Date: Fri, 23 Oct 2020 16:07:15 -0700 Subject: [PATCH] minor visual cleanup --- .../static/kbase/js/kbaseNarrative.js | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/kbase-extension/static/kbase/js/kbaseNarrative.js b/kbase-extension/static/kbase/js/kbaseNarrative.js index 3a11a15431..48713436bb 100644 --- a/kbase-extension/static/kbase/js/kbaseNarrative.js +++ b/kbase-extension/static/kbase/js/kbaseNarrative.js @@ -171,25 +171,24 @@ define([ return Promise.try(() => { if (this.workspaceRef) { return this.workspaceRef; - } else { - return new Workspace(Config.url('workspace'), { - token: this.getAuthToken(), - }) - .get_workspace_info({ id: this.workspaceId }) - .then((wsInfo) => { - let narrId = wsInfo[8]['narrative']; - this.workspaceRef = this.workspaceId + '/' + narrId; - return this.workspaceRef; - }); } + return new Workspace(Config.url('workspace'), { + token: this.getAuthToken(), + }) + .get_workspace_info({ id: this.workspaceId }) + .then((wsInfo) => { + let narrId = wsInfo[8]['narrative']; + this.workspaceRef = this.workspaceId + '/' + narrId; + return this.workspaceRef; + }); }); }; Narrative.prototype.getUserPermissions = function () { - return new Workspace(Config.url('workspace'), { + const ws = new Workspace(Config.url('workspace'), { token: this.getAuthToken(), - }) - .get_workspace_info({ id: this.workspaceId }) + }); + return ws.get_workspace_info({ id: this.workspaceId }) .then((wsInfo) => { return wsInfo[5]; }); @@ -241,15 +240,15 @@ define([ commonShortcuts.forEach(function (shortcut) { try { Jupyter.keyboard_manager.command_shortcuts.remove_shortcut(shortcut); - } catch (ex) { - console.warn('Error removing shortcut "' + shortcut + '"', ex); + } catch (e) { + console.warn('Error removing shortcut "' + shortcut + '"', e); } try { Jupyter.notebook.keyboard_manager.edit_shortcuts.remove_shortcut( shortcut ); - } catch (ex) { - // console.warn('Error removing shortcut '' + shortcut +'"', ex); + } catch (e) { + // console.warn('Error removing shortcut "' + shortcut + '"', e); } });