mirror of
https://codeberg.org/shroff/phylum.git
synced 2026-05-04 19:30:24 -05:00
[client] Fix removeListener call
This commit is contained in:
@@ -25,8 +25,11 @@ class ActionQueueStatusNotifier extends ChangeNotifier {
|
||||
// Ignore progress updates
|
||||
if (_statusMap[action].runtimeType != status.runtimeType) {
|
||||
if (status is ActionStatusDone) {
|
||||
_listeners.remove(action)?.call();
|
||||
final l = _listeners.remove(action);
|
||||
_statusMap.remove(action);
|
||||
if (l != null) {
|
||||
Future.microtask(() => l());
|
||||
}
|
||||
} else {
|
||||
_statusMap[action] = status;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ class ActionView extends StatelessWidget {
|
||||
final account = context.read<PhylumAccount>();
|
||||
String description = error.description;
|
||||
if (error is PhylumApiErrorResponse) {
|
||||
if (error.code == "name_conflict") {
|
||||
if (error.code == "resource_name_conflict") {
|
||||
description = 'Error: Another resource with this name already exists on the server.';
|
||||
}
|
||||
}
|
||||
@@ -57,8 +57,8 @@ class ActionView extends StatelessWidget {
|
||||
trailing: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IconButton(icon: const Icon(Icons.refresh), onPressed: () => context.read<PhylumActionQueue>().retryAction(action.id)),
|
||||
IconButton(icon: const Icon(Icons.delete), onPressed: () => context.read<PhylumActionQueue>().deleteAction(action.id)),
|
||||
IconButton(icon: const Icon(Icons.refresh), tooltip: 'Retry', onPressed: () => context.read<PhylumActionQueue>().retryAction(action.id)),
|
||||
IconButton(icon: const Icon(Icons.block), tooltip: 'Delete', onPressed: () => context.read<PhylumActionQueue>().deleteAction(action.id)),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -44,8 +44,11 @@ class _ActionsSliverState extends State<ActionsSliver> {
|
||||
// Ignore progress updates
|
||||
if (_statusMap[action].runtimeType != status.runtimeType) {
|
||||
if (status is ActionStatusDone) {
|
||||
_listeners.remove(action)?.call();
|
||||
final l = _listeners.remove(action);
|
||||
_statusMap.remove(action);
|
||||
if (l != null) {
|
||||
Future.microtask(() => l());
|
||||
}
|
||||
} else {
|
||||
_statusMap[action] = status;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user