Skip to content
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

Merged
merged 4 commits into from
Aug 16, 2024

Conversation

setchy
Copy link
Member

@setchy setchy commented Aug 6, 2024

Toggling this setting has no affect when there are multiple accounts authenticated.

…henticated

Signed-off-by: Adam Setch <adam.setch@outlook.com>
@setchy setchy added this to the Release 5.13.0 milestone Aug 6, 2024
@github-actions github-actions bot added the enhancement New feature or enhancement to existing functionality label Aug 6, 2024
Signed-off-by: Adam Setch <adam.setch@outlook.com>
@@ -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) {
Copy link
Member

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)}
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of this prop

showAccountHostname={
hasMultipleAccounts || settings.showAccountHostname

Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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

Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member Author

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 <adam.setch@outlook.com>
Signed-off-by: Adam Setch <adam.setch@outlook.com>
@setchy setchy merged commit 6845caa into main Aug 16, 2024
12 checks passed
@setchy setchy deleted the feature/show-account-setting branch August 16, 2024 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants