Answer the question
In order to leave comments, you need to log in
How to implement data output?
When developing the application, a not entirely clear situation arose.
There is a list (album) with music (which can be listened to), it is necessary to show the entire list of music even to an unauthorized user, the first 2 songs can be listened to by everyone, and in other cases:
1) If the user is not authorized, then you need to log in to listen
2) If the music after entering is paid, then we show the buy button
3) If the user is authorized and the album is purchased - you can listen
4) If the user is authorized and the music is free - you can listen
5) If the user is authorized, but did not buy the album - you can not listen
I.e. I understand that everything can be done with conditions, it turns out to be a rather cumbersome mess from if-else, how to implement it differently? Thank you!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question