Conversation
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
| try { | ||
| await ipfs().files.stat(PATH) | ||
| } catch (_) { | ||
| return |
There was a problem hiding this comment.
Return silently only if error is Error: file does not exist.
Everything else should be logged.
src/controls/main/pinned-files.js
Outdated
| const sendPinning = () => { send('pinning', pinning > 0) } | ||
| const inc = () => { pinning++; sendPinning() } | ||
| const dec = () => { pinning--; sendPinning() } | ||
| await ipfs().files.mkdir('/pinset_from_old_ipfs') |
There was a problem hiding this comment.
+desktop: pinset_from_old_ipfs_desktop
src/controls/main/files.js
Outdated
| const { ipfs } = opts | ||
|
|
||
| return async (_, hash, path) => { | ||
| if (!hash.startsWith('/ipfs')) { |
There was a problem hiding this comment.
People may try to add /ipns/ paths, and that should not be prefixed.
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
|
@lidel I changed the icon to the pinning one just to make it more familiar for now. What do you think? |
lidel
left a comment
There was a problem hiding this comment.
Better, but still need those titles :P
src/panes/Files.js
Outdated
|
|
||
| const path = await prompt({ | ||
| title: 'Add by IPFS Path', | ||
| label: 'How do you want to tag it?', |
There was a problem hiding this comment.
Now that we are in Files "How do you want to name it?" is a better label.
src/panes/Files.js
Outdated
|
|
||
| const hash = await prompt({ | ||
| title: 'Add by IPFS Path', | ||
| label: 'Write the IPFS path to add:', |
src/panes/Files.js
Outdated
| <IconButton active={this.state.sticky} onClick={this.toggleStickWindow} icon='eye' /> | ||
|
|
||
| <div className='right'> | ||
| <IconButton onClick={this.addFromIPFS} icon='pin-alt' /> |
There was a problem hiding this comment.
IconButton should accept title as one of its props, and use it like this:
<button title="Add by IPFS Path">[icon]</button>We really need a tooltip that describes what the button does :)
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
|
Done @lidel 😄 |
lidel
left a comment
There was a problem hiding this comment.
Thanks! I feel this should be enough for now, we don't want to spend too much time on this.
When WebUI lands we will get back to Desktop with proper redesign :) 👍
Before merging this, check logging bug below 🙃
src/controls/main/pinned-files.js
Outdated
| try { | ||
| await ipfs().files.stat(PATH) | ||
| } catch (e) { | ||
| if (e.toString().indexOf('file does not exist') !== -1) { |
There was a problem hiding this comment.
I think you meant === here :) Avoid indexOf, try using String.includes instead, it is easier to read and harder to make a mistake.
In this particular case, this should be enough:
if (e.message !== 'file does not exist') {License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
|
@hacdias would be good to make a new release with this fix. |


Closes #652