mirror of
https://gitlab.com/foxixus/neomovies_mobile.git
synced 2025-10-27 22:38:50 +05:00
fix
This commit is contained in:
@@ -14,12 +14,20 @@ class Reaction {
|
|||||||
|
|
||||||
class UserReaction {
|
class UserReaction {
|
||||||
final String? reactionType;
|
final String? reactionType;
|
||||||
|
final String? mediaType;
|
||||||
|
final String? mediaId;
|
||||||
|
|
||||||
UserReaction({this.reactionType});
|
UserReaction({
|
||||||
|
this.reactionType,
|
||||||
|
this.mediaType,
|
||||||
|
this.mediaId,
|
||||||
|
});
|
||||||
|
|
||||||
factory UserReaction.fromJson(Map<String, dynamic> json) {
|
factory UserReaction.fromJson(Map<String, dynamic> json) {
|
||||||
return UserReaction(
|
return UserReaction(
|
||||||
reactionType: json['type'] as String?,
|
reactionType: json['type'] as String?,
|
||||||
|
mediaType: json['mediaType'] as String?,
|
||||||
|
mediaId: json['mediaId'] as String?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class ReactionsRepository {
|
|||||||
return await _apiClient.getReactionCounts(mediaType, mediaId);
|
return await _apiClient.getReactionCounts(mediaType, mediaId);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<UserReaction> getMyReaction(String mediaType,String mediaId) async {
|
Future<UserReaction?> getMyReaction(String mediaType,String mediaId) async {
|
||||||
return await _apiClient.getMyReaction(mediaType, mediaId);
|
return await _apiClient.getMyReaction(mediaType, mediaId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class MovieDetailProvider with ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|
||||||
if (_movie != null) {
|
if (_movie != null) {
|
||||||
_imdbId = await _apiClient.getImdbId(mediaId, mediaType);
|
_imdbId = await _apiClient.getImdbId(mediaId.toString(), mediaType);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
_error = e.toString();
|
_error = e.toString();
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class ReactionsProvider with ChangeNotifier {
|
|||||||
|
|
||||||
if (_authProvider.isAuthenticated) {
|
if (_authProvider.isAuthenticated) {
|
||||||
final userReactionResult = await _repository.getMyReaction(mediaType, mediaId);
|
final userReactionResult = await _repository.getMyReaction(mediaType, mediaId);
|
||||||
_userReaction = userReactionResult.reactionType;
|
_userReaction = userReactionResult?.reactionType;
|
||||||
} else {
|
} else {
|
||||||
_userReaction = null;
|
_userReaction = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user