-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat(ui): file explorer tab #106
feat(ui): file explorer tab #106
Conversation
@@ -363,5 +363,7 @@ | |||
"CPU Platform": "CPU платформасы", | |||
"OS": "ОС", | |||
"SDK": "Sdk", | |||
"ABI": "АТИ" | |||
"ABI": "АТИ", |
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.
Do not translate
<Input | ||
beforeAlign='end' | ||
className={styles.input} | ||
value={fileExplorerService.currentPath} |
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 don't think it's necessary to store the editing value in the store directly. useStore should be sufficient and makes sense when you consider this input as a form input
We can change the store value in onSubmit or onBlur
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 switched to using a form, but I can't make the state local because I update the editing value in a different component, for example, when I click on a folder
const permissionSymbols = ['x', 'w', 'r'] | ||
|
||
let result = '' | ||
|
||
for (let i = 0; i < permissionSymbols.length; i++) { | ||
for (let j = 0; j < permissionSymbols.length; j++) { | ||
result = ((value >> (i * permissionSymbols.length + j)) & 1) !== 0 ? permissionSymbols[j] + result : '-' + result | ||
} | ||
} |
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.
looks complicated
Why not
const permissionSymbols = ['x', 'w', 'r'] | |
let result = '' | |
for (let i = 0; i < permissionSymbols.length; i++) { | |
for (let j = 0; j < permissionSymbols.length; j++) { | |
result = ((value >> (i * permissionSymbols.length + j)) & 1) !== 0 ? permissionSymbols[j] + result : '-' + result | |
} | |
} | |
const permissionSymbols = ['x','w','r','x','w','r','x','w','r'] | |
let result = ''.join(permissionSymbols.map((v, ind) => { | |
if ((value >> (ind)) & 1) { | |
return v; | |
} else { | |
return '-'; | |
} | |
}) |
const uninstallResult = await this.deviceControlStore.uninstall(packageName) | ||
await uninstallResult.donePromise | ||
|
||
await this.deviceControlStore.uninstall(packageName) |
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.
Why call second time?
const fsRetrieveResult = await this.deviceControlStore.fsRetrieve(path) | ||
const { content } = await fsRetrieveResult.donePromise | ||
|
||
if (content) { | ||
window.open(`${content.href}?download`, '_blank') | ||
} |
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 seems inefficient when dealing with large files. Maybe we can stream the result?
No description provided.