mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-04-20 23:22:07 +00:00
Remove check
- Remove the enableAniSkipStateProvider check, because it is already being checked by the caller (anime_player_view.dart, initState() line 353). - Change ref.watch() to ref.read() as the user cannot change its value without exiting the video player. ref.watch() is meant to be used within reactive contexts.
This commit is contained in:
parent
b1560d3eea
commit
4a986d4c15
1 changed files with 15 additions and 17 deletions
|
|
@ -193,7 +193,7 @@ class AnimeStreamController extends _$AnimeStreamController {
|
|||
}) {
|
||||
if (episode.isRead!) return;
|
||||
if (incognitoMode) return;
|
||||
final markEpisodeAsSeenType = ref.watch(markEpisodeAsSeenTypeStateProvider);
|
||||
final markEpisodeAsSeenType = ref.read(markEpisodeAsSeenTypeStateProvider);
|
||||
final isWatch =
|
||||
totalDuration != null &&
|
||||
totalDuration != Duration.zero &&
|
||||
|
|
@ -249,22 +249,20 @@ class AnimeStreamController extends _$AnimeStreamController {
|
|||
Function(List<Results>) result,
|
||||
) async {
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
if (ref.watch(enableAniSkipStateProvider)) {
|
||||
final id = _getTrackId();
|
||||
if (id != null) {
|
||||
final res = await ref
|
||||
.read(aniSkipProvider.notifier)
|
||||
.getResult(
|
||||
id,
|
||||
ChapterRecognition().parseChapterNumber(
|
||||
episode.manga.value!.name!,
|
||||
episode.name!,
|
||||
),
|
||||
0,
|
||||
);
|
||||
result.call(res ?? []);
|
||||
return res;
|
||||
}
|
||||
final id = _getTrackId();
|
||||
if (id != null) {
|
||||
final res = await ref
|
||||
.read(aniSkipProvider.notifier)
|
||||
.getResult(
|
||||
id,
|
||||
ChapterRecognition().parseChapterNumber(
|
||||
episode.manga.value!.name!,
|
||||
episode.name!,
|
||||
),
|
||||
0,
|
||||
);
|
||||
result.call(res ?? []);
|
||||
return res;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue