-
Notifications
You must be signed in to change notification settings - Fork 258
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
feat(settings): disable show accounts
when multiple accounts are authenticated
#1439
Conversation
…henticated Signed-off-by: Adam Setch <[email protected]>
Signed-off-by: Adam Setch <[email protected]>
@@ -218,3 +218,11 @@ export function isValidToken(token: Token) { | |||
export function getAccountUUID(account: Account): string { | |||
return btoa(`${account.hostname}-${account.user.id}-${account.method}`); | |||
} | |||
|
|||
export function hasAccounts(auth: AuthState) { |
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.
😅
@@ -198,7 +199,8 @@ export const AppearanceSettings: FC = () => { | |||
<Checkbox | |||
name="showAccountHostname" | |||
label="Show account hostname" | |||
checked={settings.showAccountHostname} | |||
checked={settings.showAccountHostname || hasMultipleAccounts(auth)} | |||
disabled={hasMultipleAccounts(auth)} |
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.
Why exactly do we need to disable this on multiple accounts?
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.
Because of this prop
gitify/src/routes/Notifications.tsx
Lines 45 to 46 in e7b843b
showAccountHostname={ | |
hasMultipleAccounts || settings.showAccountHostname |
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.
I see, but can't the hostname be the same on some situations?
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.
Indeed, we support repeated hostnames 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.
so single account, feature flag toggles showing the account header
multiple accounts, feature flag does nada
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.
Right, but does it make sense for it to be disabled on the situations where it is the same for example?
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.
showAccountHostname
is misleading nowdays. It really should be showAccountNameHeader
or something like that as it represents the row containing account name, account avatar, account platform type, etc
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.
Renamed in #1464
Signed-off-by: Adam Setch <[email protected]>
Signed-off-by: Adam Setch <[email protected]>
Toggling this setting has no affect when there are multiple accounts authenticated.