mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-03-28 22:01:47 +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,
|
EventTimeline,
|
||||||
EventTimelineSet,
|
EventTimelineSet,
|
||||||
EventTimelineSetHandlerMap,
|
EventTimelineSetHandlerMap,
|
||||||
IEncryptedFile,
|
|
||||||
MatrixClient,
|
MatrixClient,
|
||||||
MatrixEvent,
|
MatrixEvent,
|
||||||
Room,
|
Room,
|
||||||
|
@ -46,12 +45,7 @@ import {
|
||||||
} from 'folds';
|
} from 'folds';
|
||||||
import { isKeyHotkey } from 'is-hotkey';
|
import { isKeyHotkey } from 'is-hotkey';
|
||||||
import { Opts as LinkifyOpts } from 'linkifyjs';
|
import { Opts as LinkifyOpts } from 'linkifyjs';
|
||||||
import {
|
import { eventWithShortcode, factoryEventSentBy, getMxIdLocalPart } from '../../utils/matrix';
|
||||||
decryptFile,
|
|
||||||
eventWithShortcode,
|
|
||||||
factoryEventSentBy,
|
|
||||||
getMxIdLocalPart,
|
|
||||||
} from '../../utils/matrix';
|
|
||||||
import { useMatrixClient } from '../../hooks/useMatrixClient';
|
import { useMatrixClient } from '../../hooks/useMatrixClient';
|
||||||
import { useVirtualPaginator, ItemRange } from '../../hooks/useVirtualPaginator';
|
import { useVirtualPaginator, ItemRange } from '../../hooks/useVirtualPaginator';
|
||||||
import { useAlive } from '../../hooks/useAlive';
|
import { useAlive } from '../../hooks/useAlive';
|
||||||
|
@ -217,18 +211,6 @@ export const getEventIdAbsoluteIndex = (
|
||||||
return baseIndex + eventIndex;
|
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 = {
|
type RoomTimelineProps = {
|
||||||
room: Room;
|
room: Room;
|
||||||
eventId?: string;
|
eventId?: string;
|
||||||
|
|
Loading…
Reference in a new issue