mirror of
https://github.com/sudosylabs/vnidrop.git
synced 2026-08-05 02:29:55 +02:00
fix(apple): restore macOS approval modal and sandboxed file sharing
Approval modal: since the Share/QR sheet auto-opens after creating a transfer, it is always up when a receiver request arrives, and macOS silently drops a sheet presented while another is still dismissing — so the approval sheet never appeared. Drive the approval sheet from explicit state (not a constant binding) and, on macOS, defer its presentation one dismiss-beat after closing the Share/QR sheet so the hand-off is serialized. Still a non-dismissable sheet; iOS timing unchanged. Sandboxed file sharing: the macOS picker released its security scope immediately, so the core's later import failed with EPERM under the App Store sandbox (the non-sandboxed .dmg was unaffected). Capture a security-scoped bookmark at pick time and re-acquire access across shareFiles() — during which the core imports the bytes — mirroring the receive-folder scoped-access pattern.
This commit is contained in:
@@ -12,6 +12,10 @@ struct PickedShareFile: Equatable, Identifiable, Sendable {
|
||||
var isTemporaryCopy: Bool = false
|
||||
/// When true, `value` is a directory (path or security-scoped folder URL).
|
||||
var isDirectory: Bool = false
|
||||
/// macOS sandbox: a security-scoped bookmark captured at pick time so access to
|
||||
/// `value` can be re-acquired when the core imports the file (the picker's own
|
||||
/// scope ends immediately). Nil on iOS (which copies into the container instead).
|
||||
var securityScopeBookmark: Data? = nil
|
||||
|
||||
var id: String { value }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user