mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 23:24:21 +00:00
feat(share): record and display share activity (#549)
* feat(share): record and display share activity * style(share): remove activity entry borders * docs(share): explain share link activity
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { client } from '@/ui/api/client'
|
||||
import { requestShareDownload } from '@/ui/api/share-download'
|
||||
import DrawingCanvas from '@/ui/components/drawing-canvas'
|
||||
import { useScreenSize } from '@/ui/hooks/useScreenSize'
|
||||
import { getBestTranscode } from '@/ui/lib/media'
|
||||
@@ -118,10 +119,7 @@ export const CompareImagePane = forwardRef<ComparePaneHandle, CompareImagePanePr
|
||||
if (!key || !file.id) return
|
||||
try {
|
||||
const res = shareId
|
||||
? await client.api.shares[':shareId'].files[':fileId']['download-url'].$post({
|
||||
param: { shareId, fileId: file.id },
|
||||
json: { key },
|
||||
})
|
||||
? await requestShareDownload(shareId, file.id, key)
|
||||
: await client.api.files['download-url'].$post({
|
||||
json: { key, assetId: file.id },
|
||||
})
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useScreenSize } from '@/ui/hooks/useScreenSize'
|
||||
import { client } from '@/ui/api/client'
|
||||
import { requestShareDownload } from '@/ui/api/share-download'
|
||||
import { getBestTranscode } from '@/ui/lib/media'
|
||||
import { copyImageToClipboard } from '@/ui/lib/clipboard'
|
||||
import React, { useEffect, useRef, useState, useImperativeHandle } from 'react'
|
||||
@@ -106,10 +107,7 @@ export const ImageViewer = React.forwardRef<MediaController, FileViewerProps>(
|
||||
if (!key || !file.id) return
|
||||
try {
|
||||
const res = shareId
|
||||
? await client.api.shares[':shareId'].files[':fileId']['download-url'].$post({
|
||||
param: { shareId, fileId: file.id },
|
||||
json: { key },
|
||||
})
|
||||
? await requestShareDownload(shareId, file.id, key)
|
||||
: await client.api.files['download-url'].$post({
|
||||
json: { key, assetId: file.id },
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user