Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feat/fix local ads archiving undo #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
fulleni merged 12 commits into main from feat/fix-local-ads-archiving-undo
Sep 24, 2025
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit Hold shift + click to select a range
2db2540
refactor(local_ads_management): update ArchiveLocalAdsState for snack...
fulleni Sep 24, 2025
f5fd4b8
refactor(local_ads_management): update pending deletions handling
fulleni Sep 24, 2025
1a0405d
refactor(local_ads_management): integrate PendingDeletionsService for...
fulleni Sep 24, 2025
a034f5b
refactor(local_ads_management): improve archived ads undo delete func...
fulleni Sep 24, 2025
5db0abb
fix(archive_local_ads): remove explicit null assignment
fulleni Sep 24, 2025
afc4300
style: format
fulleni Sep 24, 2025
3114460
fix(archive_local_ads): ensure proper null checks for state properties
fulleni Sep 24, 2025
2ae6ccd
refactor(local_ads_management): update undo delete action to use bloc
fulleni Sep 24, 2025
15daa19
fix(ads): remove redundant state updates for restoredLocalAd
fulleni Sep 24, 2025
7533803
refactor(local_ads_management): remove unused restoredLocalAd field
fulleni Sep 24, 2025
4fc3846
fix(archived_local_ads_page): Prevent "deactivated widget's ancestor"...
fulleni Sep 24, 2025
6b5418b
style: format
fulleni Sep 24, 2025
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
Next Next commit
refactor(local_ads_management): update ArchiveLocalAdsState for snack...
...bar functionality
- Remove lastDeletedLocalAd field and related logic
- Add lastPendingDeletionId and snackbarLocalAdTitle fields
- Update copyWith method to accommodate new fields
- Adjust equality and hashCode methods for new state structure
  • Loading branch information
fulleni committed Sep 24, 2025
commit 2db254074f312e8aacf72b1555206ae1fe2d7154

Some comments aren't visible on the classic Files Changed page.

View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ class ArchiveLocalAdsState extends Equatable {
this.videoAdsCursor,
this.videoAdsHasMore = false,
this.exception,
this.lastDeletedLocalAd,
this.restoredLocalAd,
this.lastPendingDeletionId,
this.snackbarLocalAdTitle,
});

final ArchiveLocalAdsStatus status;
Expand Down Expand Up @@ -86,12 +87,18 @@ class ArchiveLocalAdsState extends Equatable {
/// The error describing an operation failure, if any.
final HttpException? exception;

/// The last deleted local ad, used for undo functionality.
final LocalAd? lastDeletedLocalAd;

/// The last restored local ad, used for triggering UI updates.
final LocalAd? restoredLocalAd;

/// The ID of the local ad that was most recently added to pending deletions.
/// Used to trigger the snackbar display.
final String? lastPendingDeletionId;

/// The title of the local ad for which the snackbar should be displayed.
/// This is set when a deletion is requested and cleared when the snackbar
/// is no longer needed.
final String? snackbarLocalAdTitle;

ArchiveLocalAdsState copyWith({
ArchiveLocalAdsStatus? status,
ArchiveLocalAdsStatus? nativeAdsStatus,
Expand All @@ -111,10 +118,9 @@ class ArchiveLocalAdsState extends Equatable {
String? videoAdsCursor,
bool? videoAdsHasMore,
HttpException? exception,
LocalAd? lastDeletedLocalAd,
LocalAd? restoredLocalAd,
bool clearLastDeletedLocalAd = false,
bool clearRestoredLocalAd = false,
String? lastPendingDeletionId,
String? snackbarLocalAdTitle,
}) {
return ArchiveLocalAdsState(
status: status ?? this.status,
Expand All @@ -137,13 +143,11 @@ class ArchiveLocalAdsState extends Equatable {
videoAds: videoAds ?? this.videoAds,
videoAdsCursor: videoAdsCursor ?? this.videoAdsCursor,
videoAdsHasMore: videoAdsHasMore ?? this.videoAdsHasMore,
exception: exception ?? this.exception,
lastDeletedLocalAd: clearLastDeletedLocalAd
? null
: lastDeletedLocalAd ?? this.lastDeletedLocalAd,
restoredLocalAd: clearRestoredLocalAd
? null
: restoredLocalAd ?? this.restoredLocalAd,
exception: exception, // Explicitly set to null if not provided
restoredLocalAd:
restoredLocalAd, // Explicitly set to null if not provided
lastPendingDeletionId: lastPendingDeletionId,
snackbarLocalAdTitle: snackbarLocalAdTitle,
);
}

Expand All @@ -167,7 +171,8 @@ class ArchiveLocalAdsState extends Equatable {
videoAdsCursor,
videoAdsHasMore,
exception,
lastDeletedLocalAd,
restoredLocalAd,
lastPendingDeletionId,
snackbarLocalAdTitle,
];
}

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /