fixed pending share race error on warm app start

This commit is contained in:
2026-07-02 15:28:05 +02:00
parent 4bc7ffd37a
commit 32f7c311bc
9 changed files with 125 additions and 9 deletions
+13
View File
@@ -12,4 +12,17 @@ class PendingShare {
bool get hasFiles => filePaths.isNotEmpty;
bool get hasText => text != null && text!.isNotEmpty;
bool get isEmpty => !hasFiles && !hasText;
/// True when [other] carries the same payload. The iOS Share Extension
/// fires two `open(url)` requests per share (see ShareViewController), so
/// the same share can arrive twice on the media stream — receivedAt is
/// deliberately ignored here so such duplicates compare equal.
bool contentEquals(PendingShare other) {
if (text != other.text) return false;
if (filePaths.length != other.filePaths.length) return false;
for (var i = 0; i < filePaths.length; i++) {
if (filePaths[i] != other.filePaths[i]) return false;
}
return true;
}
}