Skip to content

Commit

Permalink
Download file context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustem Mussabekov committed Nov 6, 2023
1 parent d9cb239 commit 5aee0a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/co/bookmarks/item/contextmenu.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react'
import t from '~t'
import { API_ENDPOINT_URL } from '~data/constants/app'
import Popover, { Menu, MenuItem, MenuSeparator } from '~co/overlay/popover'
import { target } from '~target'

export default function BookmarksItemContextmenu({
_id, link, important, access, reparse, cache,
_id, link, important, access, reparse, cache, fileType,
onContextMenuClose, onRemoveClick, onCopyLinkClick,
onSelectClick, onImportantClick, onReparseClick
}) {
Expand Down Expand Up @@ -33,6 +34,12 @@ export default function BookmarksItemContextmenu({
</MenuItem>
) : null}

{fileType ? (
<MenuItem href={`${API_ENDPOINT_URL}raindrop/${_id}/file?download`}>
{t.s('download')}
</MenuItem>
) : null}

{access && access.level >= 3 ? (
<>
<MenuSeparator />
Expand Down
1 change: 0 additions & 1 deletion src/data/modules/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ function* req(url, options={}, retries=0) {
let errorMessage = 'failed to load'

for(let i = 0; i <= retries; i++){
console.log(i, retries)
try{
const winner = yield race({
req: call(fetchWrap, finalURL, {...defaultOptions, ...options}),
Expand Down

0 comments on commit 5aee0a2

Please sign in to comment.