diff --git a/FlowCrypt/Functionality/Mail Provider/Message Gateway/GmailService+draft.swift b/FlowCrypt/Functionality/Mail Provider/Message Gateway/GmailService+draft.swift index c8fdf0e0b..b9de66fa2 100644 --- a/FlowCrypt/Functionality/Mail Provider/Message Gateway/GmailService+draft.swift +++ b/FlowCrypt/Functionality/Mail Provider/Message Gateway/GmailService+draft.swift @@ -42,23 +42,6 @@ extension GmailService: DraftGateway { } } - func getDraft(with identifier: String) async throws -> GTLRGmail_Draft { - try await withCheckedThrowingContinuation { (continuation: CheckedContinuation) in - - let query = GTLRGmailQuery_UsersDraftsGet.query(withUserId: .me, identifier: identifier) - - gmailService.executeQuery(query) { _, object, error in - if let error = error { - continuation.resume(throwing: GmailServiceError.providerError(error)) - } else if let draft = object as? GTLRGmail_Draft { - continuation.resume(returning: (draft)) - } else { - continuation.resume(throwing: GmailServiceError.failedToParseData(nil)) - } - } - } - } - private func createQueryForDraftAction(raw: String, threadId: String?, draft: GTLRGmail_Draft?) -> GTLRGmailQuery { guard let createdDraft = draft, diff --git a/FlowCrypt/Functionality/Mail Provider/Message Gateway/MessageGateway.swift b/FlowCrypt/Functionality/Mail Provider/Message Gateway/MessageGateway.swift index 863eaab9b..cd73045a1 100644 --- a/FlowCrypt/Functionality/Mail Provider/Message Gateway/MessageGateway.swift +++ b/FlowCrypt/Functionality/Mail Provider/Message Gateway/MessageGateway.swift @@ -20,6 +20,5 @@ protocol MessageGateway { protocol DraftGateway { func saveDraft(input: MessageGatewayInput, draft: GTLRGmail_Draft?) async throws -> GTLRGmail_Draft - func getDraft(with identifier: String) async throws -> GTLRGmail_Draft func deleteDraft(with identifier: String) async } diff --git a/FlowCrypt/Functionality/Services/Compose Message Service/ComposeMessageService.swift b/FlowCrypt/Functionality/Services/Compose Message Service/ComposeMessageService.swift index aa77a06d7..9d20da7f7 100644 --- a/FlowCrypt/Functionality/Services/Compose Message Service/ComposeMessageService.swift +++ b/FlowCrypt/Functionality/Services/Compose Message Service/ComposeMessageService.swift @@ -155,14 +155,7 @@ final class ComposeMessageService { throw ComposeMessageError.gatewayError(error) } } - - func getDraft(with identifier: String) { - Task { - // tom - unsure what this does? the result is unused - let draft = try await draftGateway?.getDraft(with: identifier) - } - } - + // MARK: - Encrypt and Send func encryptAndSend(message: SendableMsg, threadId: String?, progressHandler: ((Float) -> Void)?) async throws { do { diff --git a/FlowCryptAppTests/Mocks/DraftGatewayMock.swift b/FlowCryptAppTests/Mocks/DraftGatewayMock.swift index 95d27e151..6bdd985a0 100644 --- a/FlowCryptAppTests/Mocks/DraftGatewayMock.swift +++ b/FlowCryptAppTests/Mocks/DraftGatewayMock.swift @@ -15,9 +15,5 @@ class DraftGatewayMock: DraftGateway { return GTLRGmail_Draft() } - func getDraft(with identifier: String) async throws -> GTLRGmail_Draft { - return GTLRGmail_Draft() - } - func deleteDraft(with identifier: String) async {} }