mobile: add readonly editor

This commit is contained in:
Ammar Ahmed
2024-03-15 07:43:03 +05:00
committed by Abdullah Atta
parent c7142e409b
commit 43cb5d278c
13 changed files with 660 additions and 78 deletions

View File

@@ -103,7 +103,7 @@ export type EditorController = {
setTitlePlaceholder: React.Dispatch<React.SetStateAction<string>>;
countWords: (ms: number) => void;
copyToClipboard: (text: string) => void;
getAttachmentData: (attachment: Attachment) => Promise<string>;
getAttachmentData: (attachment: Partial<Attachment>) => Promise<string>;
updateTab: () => void;
loading: boolean;
setLoading: (value: boolean) => void;
@@ -327,7 +327,7 @@ export function useEditorController({
post(EventTypes.copyToClipboard, text);
};
const getAttachmentData = (attachment: Attachment) => {
const getAttachmentData = (attachment: Partial<Attachment>) => {
return new Promise<string>((resolve, reject) => {
const resolverId = randId("get_attachment_data");
pendingResolvers[resolverId] = (data) => {