Skip to content

Commit

Permalink
resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmer committed Jan 8, 2024
1 parent e64a3f4 commit 1ae65cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 30 deletions.
2 changes: 0 additions & 2 deletions lib/model/push_request_queue.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ class PushRequestQueue {

PushRequest? peek() => list.isNotEmpty ? list.first : null;

PushRequest pop() => list.removeAt(0);

PushRequest? tryPop() => list.isNotEmpty ? list.removeAt(0) : null;

@override
Expand Down
21 changes: 0 additions & 21 deletions lib/views/settings_view/settings_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -220,27 +220,6 @@ class SettingsView extends ConsumerWidget {
onChanged: (value) => ref.read(settingsProvider.notifier).setPolling(value),
),
),
// if (ref.watch(tokenProvider).hasHOTPTokens)
// ListTile(
// title: RichText(
// text: TextSpan(
// children: [
// TextSpan(
// text: AppLocalizations.of(context)!.hidePushTokens,
// style: Theme.of(context).textTheme.titleMedium,
// ),
// ],
// ),
// ),
// subtitle: Text(
// AppLocalizations.of(context)!.hidePushTokensDescription,
// overflow: TextOverflow.fade,
// ),
// trailing: Switch(
// value: ref.watch(settingsProvider).hidePushTokensState != HidePushTokens.notHidden,
// onChanged: (value) => ref.read(settingsProvider.notifier).setHidePushTokens(isHidden: value),
// ),
// )
],
),
),
Expand Down
14 changes: 7 additions & 7 deletions test/unit_test/utils/push_request_queue_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ void verifyCustomListBehavesLikeQueue() {
expect(fifo.isNotEmpty, true);
expect(fifo.isEmpty, false);

var pop = fifo.pop();
expect(pop, pushRequest);
var tryPop = fifo.tryPop();
expect(tryPop, pushRequest);

expect(fifo.isNotEmpty, false);
expect(fifo.isEmpty, true);
Expand Down Expand Up @@ -126,18 +126,18 @@ void verifyCustomListBehavesLikeQueue() {
fifo.add(three);

expect(fifo.peek(), queue.first);
fifo.pop();
fifo.tryPop();
queue.removeFirst();
expect(fifo.peek(), queue.first);

queue.addLast(four);
fifo.add(four);
queue.addLast(five);
fifo.add(five);
expect(fifo.pop(), queue.removeFirst());
expect(fifo.pop(), queue.removeFirst());
expect(fifo.pop(), queue.removeFirst());
expect(fifo.pop(), queue.removeFirst());
expect(fifo.tryPop(), queue.removeFirst());
expect(fifo.tryPop(), queue.removeFirst());
expect(fifo.tryPop(), queue.removeFirst());
expect(fifo.tryPop(), queue.removeFirst());

expect(fifo.isEmpty, true);
expect(queue.isEmpty, true);
Expand Down

0 comments on commit 1ae65cb

Please sign in to comment.