mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-02-07 14:23:38 +01:00
remove dead code
This commit is contained in:
parent
05859bf89c
commit
2feb4feee2
1 changed files with 1 additions and 19 deletions
|
@ -16,7 +16,6 @@ import {
|
|||
EventTimeline,
|
||||
EventTimelineSet,
|
||||
EventTimelineSetHandlerMap,
|
||||
IEncryptedFile,
|
||||
MatrixClient,
|
||||
MatrixEvent,
|
||||
Room,
|
||||
|
@ -46,12 +45,7 @@ import {
|
|||
} from 'folds';
|
||||
import { isKeyHotkey } from 'is-hotkey';
|
||||
import { Opts as LinkifyOpts } from 'linkifyjs';
|
||||
import {
|
||||
decryptFile,
|
||||
eventWithShortcode,
|
||||
factoryEventSentBy,
|
||||
getMxIdLocalPart,
|
||||
} from '../../utils/matrix';
|
||||
import { eventWithShortcode, factoryEventSentBy, getMxIdLocalPart } from '../../utils/matrix';
|
||||
import { useMatrixClient } from '../../hooks/useMatrixClient';
|
||||
import { useVirtualPaginator, ItemRange } from '../../hooks/useVirtualPaginator';
|
||||
import { useAlive } from '../../hooks/useAlive';
|
||||
|
@ -217,18 +211,6 @@ export const getEventIdAbsoluteIndex = (
|
|||
return baseIndex + eventIndex;
|
||||
};
|
||||
|
||||
export const factoryGetFileSrcUrl =
|
||||
(httpUrl: string, mimeType: string, encFile?: IEncryptedFile) => async (): Promise<string> => {
|
||||
if (encFile) {
|
||||
if (typeof httpUrl !== 'string') throw new Error('Malformed event');
|
||||
const encRes = await fetch(httpUrl, { method: 'GET' });
|
||||
const encData = await encRes.arrayBuffer();
|
||||
const decryptedBlob = await decryptFile(encData, mimeType, encFile);
|
||||
return URL.createObjectURL(decryptedBlob);
|
||||
}
|
||||
return httpUrl;
|
||||
};
|
||||
|
||||
type RoomTimelineProps = {
|
||||
room: Room;
|
||||
eventId?: string;
|
||||
|
|
Loading…
Reference in a new issue