fixed stale state after logout and replayed or lost share intents
This commit is contained in:
@@ -5,11 +5,17 @@ class PendingShare {
|
||||
final String? text;
|
||||
final DateTime receivedAt;
|
||||
|
||||
/// Paths as delivered by the platform, before the listener moved them into
|
||||
/// a per-share folder. Duplicate detection compares these, since the
|
||||
/// relocated [filePaths] differ for every delivery.
|
||||
final List<String> sourcePaths;
|
||||
|
||||
const PendingShare({
|
||||
required this.filePaths,
|
||||
required this.text,
|
||||
required this.receivedAt,
|
||||
});
|
||||
List<String>? sourcePaths,
|
||||
}) : sourcePaths = sourcePaths ?? filePaths;
|
||||
|
||||
bool get hasFiles => filePaths.isNotEmpty;
|
||||
bool get hasText => text != null && text!.isNotEmpty;
|
||||
@@ -20,5 +26,5 @@ class PendingShare {
|
||||
/// the same share can arrive twice on the media stream — receivedAt is
|
||||
/// deliberately ignored here so such duplicates compare equal.
|
||||
bool contentEquals(PendingShare other) =>
|
||||
text == other.text && listEquals(filePaths, other.filePaths);
|
||||
text == other.text && listEquals(sourcePaths, other.sourcePaths);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user