mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
Remove updateFolder because it's no longer used
This commit is contained in:
@@ -386,32 +386,15 @@ class NoteList extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pinToTop (e, uniqueKey) {
|
pinToTop (e, uniqueKey) {
|
||||||
const { data, location } = this.props
|
const { data, params } = this.props
|
||||||
let splitted = location.pathname.split('/')
|
const storageKey = params.storageKey
|
||||||
const storageKey = splitted[2]
|
const folderKey = params.folderKey
|
||||||
const folderKey = splitted[4]
|
|
||||||
|
|
||||||
const currentStorage = data.storageMap.get(storageKey)
|
const currentStorage = data.storageMap.get(storageKey)
|
||||||
const currentFolder = _.find(currentStorage.folders, {key: folderKey})
|
const currentFolder = _.find(currentStorage.folders, {key: folderKey})
|
||||||
|
|
||||||
dataApi
|
const targetIndex = _.findIndex(this.notes, (note) => {
|
||||||
.updateFolder(storageKey, folderKey, {
|
return note != null && `${note.storage}-${note.key}` === uniqueKey
|
||||||
color: currentFolder.color,
|
|
||||||
name: currentFolder.name,
|
|
||||||
pinnedNote: uniqueKey.split('-').pop()
|
|
||||||
})
|
|
||||||
.then((data) => {
|
|
||||||
store.dispatch({
|
|
||||||
type: 'UPDATE_FOLDER',
|
|
||||||
storage: data.storage
|
|
||||||
})
|
|
||||||
this.setState({
|
|
||||||
status: 'IDLE'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
let targetIndex = _.findIndex(this.notes, (note) => {
|
|
||||||
return note != null && note.storage + '-' + note.key === uniqueKey
|
|
||||||
})
|
})
|
||||||
let note = this.notes[targetIndex]
|
let note = this.notes[targetIndex]
|
||||||
note.isPinned = !note.isPinned
|
note.isPinned = !note.isPinned
|
||||||
|
|||||||
Reference in New Issue
Block a user