Skip to content

Commit

Permalink
Починил кнопку добавления заметки в избранное
Browse files Browse the repository at this point in the history
  • Loading branch information
YarikMix committed May 24, 2024
1 parent 43224d1 commit 88cc322
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion public/src/components/NoteMenu/NoteMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ export class NoteMenu extends ScReact.Component<any, any> {
this.props.openSharePanel()
}

toggleFavorite = () => {
AppDispatcher.dispatch(NotesActions.TOGGLE_FAVORITE, this.props.note)
}

render() {
const isOwner = this.props.note?.owner_id == AppUserStore.state.user_id
const isAuth = AppUserStore.state.isAuth
Expand Down Expand Up @@ -103,7 +107,7 @@ export class NoteMenu extends ScReact.Component<any, any> {
}

{isAuth ?
<div className="options-item">
<div className="options-item" onclick={this.toggleFavorite}>
<Img src={this.props.note?.favorite ? "star-filled.svg" : "star.svg"} className="icon"/>
<span>{this.props.note?.favorite ? "Удалить из избранного" : "В избранное"}</span>
</div> : ""
Expand Down
2 changes: 2 additions & 0 deletions public/src/components/SharePanel/SharePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export class SharePanel extends ScReact.Component<any, any> {
note_id: AppNotesStore.state.selectedNote.id,
username: value
})

this.inviteInputRef.value = ""
}
}

Expand Down

0 comments on commit 88cc322

Please sign in to comment.