Skip to content

Commit

Permalink
fix: pin status
Browse files Browse the repository at this point in the history
  • Loading branch information
Gozala committed Aug 7, 2020
1 parent 229a66c commit fc6d501
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/bundles/files/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ export default () => ({
*/
async (ipfs) => {
const cids = await all(getPinCIDs(ipfs))
return { pins: cids }

return { pins: cids.map(String) }
}
),

Expand Down
2 changes: 1 addition & 1 deletion src/files/files-list/FilesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export class FilesList extends React.Component {
<div key={key} style={style}>
<File
{...files[index]}
pinned={pins.includes(files[index].cid)}
pinned={pins.includes(files[index].cid.toString())}
ref={r => { this.filesRefs[files[index].name] = r }}
isMfs={filesPathInfo.isMfs}
name={files[index].name}
Expand Down
3 changes: 2 additions & 1 deletion src/files/header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class Header extends React.Component {
const pos = this.dotsWrapper.getBoundingClientRect()
this.props.handleContextMenu(ev, 'TOP', {
...this.props.files,
pinned: this.props.pins.includes(this.props.files.cid)
pinned: this.props.pins.includes(this.props.files.cid.toString()),
_: console.log(this.props)
}, pos)
}

Expand Down

0 comments on commit fc6d501

Please sign in to comment.