-
Notifications
You must be signed in to change notification settings - Fork 374
Conversation
eee3744 to
620d3fb
Compare
| this.storageConnections = Store.get(this.STORE_KEY); | ||
| this.storageConnections.forEach(s => { | ||
| this.createFolderRecurively(s.defaultPath); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the user has changed their default folder and then deleted the one we create? Won't this create /Documents/Composer every time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default path is set in file data.template.json. It does not allow users to change it. These lines of code is to make sure the default path is always valid.
a-b-r-o-w-n
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some questions about edge cases.
8044e2b to
d0eb0b2
Compare
| if (fs.existsSync(s.path)) { | ||
| temp.path = Path.resolve(s.path); // resolve path if path is relative, and change it to unix pattern | ||
| } else { | ||
| this.createDefaultBotFolders(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are creating all folders inside a for loop. It's a O(n2) operation.
my suggestion is call this method "ensureFolderExisit", and put this after this map.
|
@liweitian there is a lint failure |
cwhitten
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to address lint issue
c6468d5 to
eb0cde2
Compare
This reverts commit 8f2bc2e.
Description
Task Item
Closes #1506
Closes #1363
Type of change
Bug fix (non-breaking change which fixes an issue)