forked from Ninjalama/streamyfin_mirror
Fix mark as played sheet logic being reversed (#443)
This commit is contained in:
@@ -46,7 +46,7 @@ export const PlayedStatus: React.FC<Props> = ({ item, ...props }) => {
|
||||
<RoundButton
|
||||
fillColor={item.UserData?.Played ? "primary" : undefined}
|
||||
icon={item.UserData?.Played ? "checkmark" : "checkmark"}
|
||||
onPress={() => markAsPlayedStatus(item.UserData?.Played || false)}
|
||||
onPress={() => markAsPlayedStatus(!item.UserData?.Played)}
|
||||
size="large"
|
||||
/>
|
||||
</View>
|
||||
|
||||
@@ -51,17 +51,17 @@ export const useMarkAsPlayed = (item: BaseItemDto) => {
|
||||
|
||||
try {
|
||||
if (played) {
|
||||
await markAsNotPlayed({
|
||||
api: api,
|
||||
itemId: item?.Id,
|
||||
userId: user?.Id,
|
||||
});
|
||||
await markAsPlayed({
|
||||
api: api,
|
||||
item: item,
|
||||
userId: user?.Id,
|
||||
});
|
||||
} else {
|
||||
await markAsPlayed({
|
||||
api: api,
|
||||
item: item,
|
||||
userId: user?.Id,
|
||||
});
|
||||
await markAsNotPlayed({
|
||||
api: api,
|
||||
itemId: item?.Id,
|
||||
userId: user?.Id,
|
||||
});
|
||||
}
|
||||
invalidateQueries();
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user