Fixed default theme button in theme settings (#18656)

no issue

- the default theme (currently Source) showed Activate despite being
active already, which may lead to confusion.
- This fix checks whether it's already to more accurately display the
wording of the button

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 4fd443c</samp>

Fix theme preview button label for default theme. Hide the activate
button for the default theme if it is already active in
`ThemePreview.tsx`.
This commit is contained in:
Ronald Langeveld 2023-10-17 10:15:58 +07:00 committed by GitHub
parent 7f67e98e28
commit a562cc7c7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,7 +72,7 @@ const ThemePreview: React.FC<{
if (isInstalling) {
installButtonLabel = 'Installing...';
} else if (selectedTheme.ref === 'default') {
} else if (selectedTheme.ref === 'default' && !installedTheme?.active) {
installButtonLabel = `Activate ${selectedTheme.name}`;
} else if (installedTheme) {
installButtonLabel = `Update ${selectedTheme.name}`;