fix(upload-status): always sort list

This commit is contained in:
Prateek Sunal 2024-09-06 02:38:54 +05:30
parent c67540b728
commit 1e6d91b50f
2 changed files with 6 additions and 3 deletions

View File

@ -1,7 +1,7 @@
enum BackupItemStatus {
inBackground,
retry,
inQueue,
inBackground,
uploading,
completed,
retry,
}

View File

@ -1,6 +1,7 @@
// ignore_for_file: public_member_api_docs, sort_constructors_first
import "dart:collection";
import "package:collection/collection.dart";
import 'package:flutter/material.dart';
import "package:photos/core/event_bus.dart";
import "package:photos/events/backup_updated_event.dart";
@ -37,7 +38,9 @@ class _BackupStatusScreenState extends State<BackupStatusScreen> {
@override
Widget build(BuildContext context) {
final List<BackupItem> items = this.items.values.toList();
final List<BackupItem> items = this.items.values.toList().sorted(
(a, b) => a.status.index.compareTo(b.status.index),
);
return Scaffold(
body: CustomScrollView(