Skip to content

Commit

Permalink
refactor: - modify componentString variable closer to its usage (no n…
Browse files Browse the repository at this point in the history
…eed to modify it where it was used) (#2488)
  • Loading branch information
ilandikov authored Dec 8, 2023
1 parent 90a32f8 commit 6bee5cb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/TaskLineRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,8 @@ export class TaskLineRenderer {
const emojiSerializer = TASK_FORMATS.tasksPluginEmoji.taskSerializer;
// Render and build classes for all the task's visible components
for (const component of taskLayout.shownTaskLayoutComponents) {
let componentString = emojiSerializer.componentToString(task, taskLayout, component);
const componentString = emojiSerializer.componentToString(task, taskLayout, component);
if (componentString) {
if (component === 'description') {
componentString = GlobalFilter.getInstance().removeAsWordFromDependingOnSettings(componentString);
}
// Create the text span that will hold the rendered component
const span = document.createElement('span');
parentElement.appendChild(span);
Expand Down Expand Up @@ -224,6 +221,8 @@ export class TaskLineRenderer {
task: Task,
) {
if (component === 'description') {
componentString = GlobalFilter.getInstance().removeAsWordFromDependingOnSettings(componentString);

const { debugSettings } = getSettings();
if (debugSettings.showTaskHiddenData) {
// Add some debug output to enable hidden information in the task to be inspected.
Expand Down

0 comments on commit 6bee5cb

Please sign in to comment.