I’m building a freelance platform. What is the best approach to setting a user offline or offline. I’ve tried states but it doesn’t work when you reload the page as the state is set by default to online. I want users to be able to set their status to invisible and remember that status.
I can do that with database value yes/no, but not sure what the best approach is.
If you want the user to be able to change that for himself manually then I think a yes/no would suffice. Just set a data type under user called status or something. You can update that depending on what the user does. Unless you want to use a text and set it to Online/Offline and possibly something else in the future like Online/Offline/Unavailable/Available etc.
I hope that’s helpful.
If you are looking for when the user is actually online at the moment then I think there is a plugin that could help with that.
You could use a combo… the workflow would set a state and save to the database. When you load the page you would set the state by referencing the database.
I would say this is 99% of the time this is redundant redundant, but you get a little bit faster switching times by changing the state first.