-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: location select Content component #1668
Conversation
Composer/packages/client/src/CreationFlow/DefineConversation/index.js
Outdated
Show resolved
Hide resolved
Composer/packages/client/src/CreationFlow/DefineConversation/index.js
Outdated
Show resolved
Hide resolved
Composer/packages/client/src/CreationFlow/DefineConversation/index.js
Outdated
Show resolved
Hide resolved
Composer/packages/client/src/CreationFlow/DefineConversation/index.js
Outdated
Show resolved
Hide resolved
Composer/packages/client/src/CreationFlow/DefineConversation/index.js
Outdated
Show resolved
Hide resolved
Composer/packages/client/src/CreationFlow/DefineConversation/index.js
Outdated
Show resolved
Hide resolved
Composer/packages/client/src/CreationFlow/DefineConversation/index.js
Outdated
Show resolved
Hide resolved
Composer/packages/client/src/CreationFlow/DefineConversation/index.js
Outdated
Show resolved
Hide resolved
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.
Left a few comments. My main request is that DefineConversation/index.js
be converted to typescript.
Composer/packages/client/src/CreationFlow/DefineConversation/index.js
Outdated
Show resolved
Hide resolved
Composer/packages/client/src/CreationFlow/DefineConversation/index.js
Outdated
Show resolved
Hide resolved
Composer/packages/client/src/CreationFlow/DefineConversation/index.js
Outdated
Show resolved
Hide resolved
}) && | ||
i < MAXTRYTIMES | ||
); | ||
return defaultName; |
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.
So if MAXTRYTIMES
is reached without finding a unique name, the default name will be the last computed name and invalid right?
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.
Previously, it will be an endless loop if we cannot find an unique name(probably due to a bug). According to @compulim, we should throw an error when the MAXTIMES reached. But I feel even if this do happen, we should not decrease user's experience. This is a small feature. So I keep the code this way just like what you said. If the code generate a duplicated name, an error message will show.
Composer/packages/client/src/CreationFlow/LocationBrowser/LocationSelectContent.tsx
Outdated
Show resolved
Hide resolved
Composer/packages/client/src/CreationFlow/LocationBrowser/LocationSelectContent.tsx
Show resolved
Hide resolved
if (storages && storages.length > 0) { | ||
const storageId = storages[currentStorageIndex.current].id; | ||
const path = storages[currentStorageIndex.current].path; | ||
const formatedPath = Path.normalize(path); |
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.
This was marked resolved, but was not addressed.
754dce4
to
37cc1da
Compare
Description
Refactor the locationSelectContent part to make it more pure.
The overall idea/code flow becomes. Every time we changed the location(the last accessed path), it will save to data.json, then the storages in stores(global state) will be changed too. This will trigger updating the focuedStorageFolder.
Task Item
closes #1603
closes #1291
Type of change
Please delete options that are not relevant.
Checklist
Screenshots