Skip to content

Commit

Permalink
fix(focus): optimize focus rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Mollweide committed May 5, 2018
1 parent d552720 commit 5612bec
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/renderFocus/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/* eslint no-console: 0*/
'use strict';
const { getState, getUiState } = require('../store');
const { getTerminal } = require('../getTerminalPanel');
const { getDimensions } = require('../getDimensions');
const renderAllPanels = require('../renderAllPanels');

/**
Expand All @@ -12,13 +10,10 @@ const renderAllPanels = require('../renderAllPanels');
function renderFocus() {
const state = getState();
const uiState = getUiState();
const dimensions = getDimensions();
const panelWidth = parseInt(dimensions.width, 10);
const panelHeight = parseInt(dimensions.height, 10) - 1;
const currentState = Object.assign({}, state);

if (currentState[uiState.focus]) {
uiState.print(getTerminal(panelWidth, panelHeight, uiState.focus, currentState[uiState.focus].log).join(''));
uiState.print(`${currentState[uiState.focus].log.join('\n')}\n\n`);
return;
}

Expand Down

0 comments on commit 5612bec

Please sign in to comment.