Skip to content

Remove trash success notifications #19534

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
merged 4 commits into from
Jun 27, 2025
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { UmbRepositoryBase } from '@umbraco-cms/backoffice/repository';
export abstract class UmbRecycleBinRepositoryBase extends UmbRepositoryBase implements UmbRecycleBinRepository {
#recycleBinSource: UmbRecycleBinDataSource;
#notificationContext?: typeof UMB_NOTIFICATION_CONTEXT.TYPE;
#requestTrashSuccessNotification?: UmbNotificationHandler;
#requestRestoreSuccessNotification?: UmbNotificationHandler;

/**
Expand All @@ -48,15 +47,7 @@ export abstract class UmbRecycleBinRepositoryBase extends UmbRepositoryBase impl
* @memberof UmbRecycleBinRepositoryBase
*/
async requestTrash(args: UmbRecycleBinTrashRequestArgs) {
const { error } = await this.#recycleBinSource.trash(args);

if (!error) {
this.#requestTrashSuccessNotification?.close();
const notification = { data: { message: `Trashed` } };
this.#requestTrashSuccessNotification = this.#notificationContext?.peek('positive', notification);
}

return { error };
return this.#recycleBinSource.trash(args);
}

/**
Expand All @@ -69,6 +60,7 @@ export abstract class UmbRecycleBinRepositoryBase extends UmbRepositoryBase impl
const { error } = await this.#recycleBinSource.restore(args);

if (!error) {
// TODO: keep this notification until we refresh the tree/structure correctly after the action
this.#requestRestoreSuccessNotification?.close();
const notification = { data: { message: `Restored` } };
this.#requestRestoreSuccessNotification = this.#notificationContext?.peek('positive', notification);
Expand All @@ -83,13 +75,6 @@ export abstract class UmbRecycleBinRepositoryBase extends UmbRepositoryBase impl
* @memberof UmbRecycleBinRepositoryBase
*/
async requestEmpty() {
const { error } = await this.#recycleBinSource.empty();

if (!error) {
const notification = { data: { message: `Recycle Bin Emptied` } };
this.#notificationContext?.peek('positive', notification);
}

return this.#recycleBinSource.empty();
}

Expand Down
Loading