Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions Sources/PulseUI/Helpers/ShareItems.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public enum ShareStoreOutput: String, RawRepresentable, Codable, CaseIterable {
}
}

package struct ShareItems: Identifiable {
package let id = UUID()
package let items: [Any]
package let size: Int64?
package let cleanup: () -> Void
public struct ShareItems: Identifiable {
public let id = UUID()
public let items: [Any]
public let size: Int64?
public let cleanup: () -> Void

package init(_ items: [Any], size: Int64? = nil, cleanup: @escaping () -> Void = { }) {
self.items = items
Expand All @@ -41,10 +41,8 @@ package struct ShareItems: Identifiable {
}
}

package enum ShareService {
private static var task: ShareStoreTask?
Copy link
Author

@evsaev evsaev Jun 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn’t have to be part of the PR, but I noticed it’s unused -> can safely be removed


package static func share(_ entities: [NSManagedObject], store: LoggerStore, as output: ShareOutput) async throws -> ShareItems {
public enum ShareService {
public static func share(_ entities: [NSManagedObject], store: LoggerStore, as output: ShareOutput) async throws -> ShareItems {
try await withUnsafeThrowingContinuation { continuation in
ShareStoreTask(entities: entities, store: store, output: output) {
if let value = $0 {
Expand All @@ -56,12 +54,12 @@ package enum ShareService {
}
}

package static func share(_ message: LoggerMessageEntity, as output: ShareOutput) -> ShareItems {
public static func share(_ message: LoggerMessageEntity, as output: ShareOutput) -> ShareItems {
let string = TextRenderer(options: .sharing).make { $0.render(message) }
return share(string, as: output)
}

package static func share(_ task: NetworkTaskEntity, as output: ShareOutput, store: LoggerStore) -> ShareItems {
public static func share(_ task: NetworkTaskEntity, as output: ShareOutput, store: LoggerStore) -> ShareItems {
let string = TextRenderer(options: .sharing).make { $0.render(task, content: .sharing, store: store) }
return share(string, as: output)
}
Expand Down