The value of imports.ui.main.sessionMode.currentMode (ubuntu) is not the
login name, but the name of the ubuntu session.

I'm sorry to say it but the gjs guide is wrong in assuming that's always
the case as further sessions can be added.

However, you can definitely check whether the used session is an user
one by just ensuring:

imports.ui.main.sessionMode.currentMode === 'user' ||
imports.ui.main.sessionMode.parentMode === 'user'

As any custom session that is still an user session will have the
parentMode set.

** Changed in: gjs (Ubuntu)
       Status: New => Won't Fix

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1975402

Title:
  GJS returns wrong session mode

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gjs/+bug/1975402/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to