Mibew / mibew

Mibew Messenger - open-source live support application
https://mibew.org
Other
472 stars 204 forks source link

Bug: Online/Offline Value in Admin is Inconsistent #181

Closed MichaelTunnell closed 7 years ago

MichaelTunnell commented 8 years ago
                        {{#if warnOffline}}
                            {{#unless isOnline}}
                                echo offline
                            {{/unless}}
                        {{else}}
                                echo online
                        {{/if}}

The above code is used to indicate if an operator is logged in or not but the value it outputs is inconsistent depending on the page parsing it.

On the dashboard:

In the console (visitors page):

On any other page:


This can be tested using my theme where I moved the indicator to the side menu.

faf commented 7 years ago

Well, actually the given code should not be used the way you've described. There is a logical mistake. If the appropriate warning is switched off (or not defined), then the operator will be shown as "online" regardless of his actual status.

faf commented 7 years ago

At the same time I understand that you want to be able to get an actual status of an operator on any page in the administrative interface.

faf commented 7 years ago

Now one could use is_online value in the templates for any page of the administrative interface.

MichaelTunnell commented 7 years ago

Awesome, so I can modify my theme to use the new is_online call to display it how I intended?

faf commented 7 years ago

Please wait for a while until we release 2.2.0. At the moment I can't guarantee that the variable's name will stay the same.

MichaelTunnell commented 7 years ago

that's fine . . . I will just put it as a known bug so people can be aware of the issue in the meantime.

faf commented 7 years ago

So, it's done, the name will be the same old isOnline.

MichaelTunnell commented 7 years ago

So I assume I won't need to change the code after all?

faf commented 7 years ago

Yep, seems so.

MichaelTunnell commented 7 years ago

Nice! ;)