-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(Tizen) Add logout to exit menu #5271
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tbf, I think it would be better to fix Remember Me
behaviour:
- Use
sessionStore
(or session cookies) to store the credentials. - Make
Remember Me
unchecked by default. This requires1
. Otherwise, opening links in the new tab doesn't sign in. - Uncheck
Remember Me
when password-less graphical login is used.
This way, you stay logged in until you close the app/browser.
My efforts:
#2481
jellyfin-archive/jellyfin-apiclient-javascript#154
ApiClient is deprecated and we are moving to React, so I am not sure how to do all of the above.
src/components/apphost.js
Outdated
@@ -308,12 +308,17 @@ function askForExit() { | |||
exitPromise = actionsheet.show({ | |||
title: globalize.translate('MessageConfirmAppExit'), | |||
items: [ | |||
{ id: 'logout', name: globalize.translate('ButtonSignOut') }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't logout
menu entry be added only if the user is logged in?
Also, I don't think logout
should be the default action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't logout menu entry be added only if the user is logged in?
Good point, I should add a check for that.
Also, I don't think logout should be the default action.
That could be a point for discussion indeed. IMO not many people would actually go through this menu to close the app on their TV, if the app even is fully closed at all. More users would probably be switching between accounts.
Seeing as putting this option between 'Yes' and 'No' does not feel right aesthetically, and way at the bottom messes with the UX of having cancel / ignore as the always last option this seemed to be the best place to keep it for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO not many people would actually go through this menu to close the app on their TV, if the app even is fully closed at all.
This menu is what Samsung suggests for exiting the app on Back
action. And I think it does close it compared to opening another app - it doesn't restore the state when re-launching.
Seeing as putting this option between 'Yes' and 'No' does not feel right aesthetically, and way at the bottom messes with the UX of having cancel / ignore as the always last option this seemed to be the best place to keep it for now.
In fact, No
should be the default.
It can be marked as selected:
selected?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This menu is what Samsung suggests for exiting the app on Back action. And I think it does close it compared to opening another app - it doesn't restore the state when re-launching.
That is the way this menu currently functions, yes. What I'm suggesting is that most people are unlikely to close the app using this menu. Either the app is suspended into the background when a new app is opened, or if the app actually needs to be closed completely users would be likely to force-close it rather than going through a menu.
It can be marked as selected:
I've been testing with that, but it seems this option only puts a checkmark in front of the item. Not actually highlighting it as the active selection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be likely to force-close it
Force-close is the last option to exit, not the correct way to close the app.
Not actually highlighting it as the active selection.
In Chrome (device mode to emulate Tizen + a hack to call the menu) it is highlighted, but the checkmark is not desirable. We need to add an option that allows us to set the current menu item.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force-close is the last option to exit, not the correct way to close the app.
Based on my experience with end users they don't care about the "correct way", but rather most convenient / easiest / or fastest way. Though that's a bit beside the point, it does illustrate why I believe the exit menu would be a good place to add a logout option. It's much more convenient than navigating through the menu to log out, and it's a better option to force closing the app to switch accounts.
I'm fine with discussing placement / sorting of the options in the exit menu and which should be highlighted by default. Though if changes need to be made to the way these menus are currently implemented that would best be handled in another issue.
I'd love to see improvements to the Login + Remember Me behavior, but that would require too many changes and must be done properly. A task I'm currently not able to take on. The main thing this PR adds though is easier user switching. Which is still a separate issue from the remember me state of each user. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint doesn't pass. Please fix all ESLint issues.
exitPromise = null; | ||
import('../utils/dashboard').then(() => { | ||
import('../components/actionSheet/actionSheet').then((actionsheet) => { | ||
const userId = Dashboard.getCurrentUserId(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Dashboard' is not defined. no-undef
if (value === 'yes') { | ||
doExit(); | ||
} else if (value === 'logout') { | ||
Dashboard.logout(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Dashboard' is not defined. no-undef
b895aaa
to
4388e5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint doesn't pass. Please fix all ESLint issues.
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint doesn't pass. Please fix all ESLint issues.
} | ||
}).finally(function () { | ||
exitPromise = null; | ||
import('../utils/dashboard').then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least use the result.
import('../utils/dashboard').then(() => { | |
import('../utils/dashboard').then((Dashboard) => { |
Should we use camelCase (dashboard
) since it is a variable? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utils/dashboard
exports Dashboards
so it is available for use without grabbing the result.
Tested on TV and working as intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it works, but there are ESLint errors.
I asked the team and got the answer: We should use the import in our code. The global is for use in places outside of web (plugins, wrapper apps, etc).
Changes
Adds
Sign Out
option to Tizen TV exit menu to mitigate the hassle of switching users that would otherwise require much more interaction.Users would either have to: