Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Changing the text for wrong file error #256

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions client/src/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2043,6 +2043,8 @@ function getOpenFileErrorDialog(options) {
seperator = ' or ';
} else if (!isFirst) {
seperator = ', ';
} else if(isLast && providerNames.length === 1) {
Copy link
Contributor

@pinussilvestrus pinussilvestrus Oct 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I'd change the if-else order

if(providerNames.length == 1) {
  seperator = '';
} else if (isLast) {
  seperator = ' or ';
} else if (!isFirst) {
  seperator = ', ';
} 

or even outside of the reduce function

let providerNamesString;

if(providerNames.length == 1) {
  providerNamesString = providerNames[0];
} else {
  
  // the current logic
  providerNamesString = providerNames.reduce(...)
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@imrishabh18 any thoughts?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I will change the if-else order then @pinussilvestrus

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any updates on this @imrishabh18 ? Can we move forward?

seperator = ' ';
}

return `${ string }${ seperator }${ providerName }`;
Expand Down