Making Share Target functional
This commit is contained in:
@ -74,17 +74,30 @@ export default class EntryList extends Component<{ vault: Promise<IVault> }, { n
|
||||
}
|
||||
}
|
||||
|
||||
const deleteNote = async () => {
|
||||
Notes.delete(note._id).then(() => {
|
||||
Notifications.sendSuccess("Deleted")
|
||||
this.rawNotes = this.rawNotes.filter(e => e._id !== note._id);
|
||||
this.setState({ notes: this.state.notes.filter(e => e._id !== note._id) });
|
||||
}).catch(err => {
|
||||
Notifications.sendError(err);
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
let share;
|
||||
if ((window.navigator as any).share) {
|
||||
share = <button class="uk-button" onClick={() => shareNote()}>
|
||||
share = <button class="uk-button" onClick={shareNote}>
|
||||
share
|
||||
</button>
|
||||
let context = <ContextMenu event={evt} >
|
||||
{share}
|
||||
</ContextMenu>
|
||||
|
||||
this.setState({ context });
|
||||
}
|
||||
|
||||
let context = <ContextMenu event={evt} >
|
||||
{share}
|
||||
<button class="uk-button" onClick={deleteNote}>delete</button>
|
||||
</ContextMenu>
|
||||
|
||||
this.setState({ context });
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user