Skip to content

Commit

Permalink
Actually use text property in notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexios80 committed Nov 21, 2023
1 parent fde42e8 commit 6c43de5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class ScoreFetchController {
StringDiff(previousData.isFlutterFavorite, data.isFlutterFavorite),
PackageDataField.dependents:
SetDiff(previousData.dependents, data.dependents),
}..removeWhere((key, value) => !value.isDifferent);
}..removeWhere((key, value) => !value.different);
} else {
changes = {};
}
Expand Down
6 changes: 3 additions & 3 deletions pub_stats_collector/lib/model/diff.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ abstract class Diff<T> {

Diff(this.before, this.after);

bool get isDifferent;
bool get different;
String get text;
}

class StringDiff extends Diff<Object> {
StringDiff(super.before, super.after);

@override
bool get isDifferent => before != after;
bool get different => before != after;

@override
String get text => '$before -> $after';
Expand All @@ -24,7 +24,7 @@ class SetDiff extends Diff<Set<String>> {
SetDiff(super.before, super.after);

@override
bool get isDifferent => !const SetEquality().equals(before, after);
bool get different => !const SetEquality().equals(before, after);

@override
String get text {
Expand Down
2 changes: 1 addition & 1 deletion pub_stats_collector/lib/repo/discord_repo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class DiscordRepo {
...changes.entries.map(
(e) => EmbedField(
name: e.key.name.titleCase,
value: '${e.value.before} -> ${e.value.after}',
value: e.value.text,
),
),
if (warnings.isNotEmpty)
Expand Down

0 comments on commit 6c43de5

Please sign in to comment.