Skip to content

Commit

Permalink
Fix more google translate crashes
Browse files Browse the repository at this point in the history
isLoading will cause crashes if the body content is not wrapped in span. the nodes must always exist throughout the button lifecycle
  • Loading branch information
synzen committed Jan 19, 2025
1 parent c5dccd4 commit 0b98185
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const AddFilterDialog: React.FC<Props> = ({ onSubmit }) => {
return (
<>
<Button colorScheme="blue" isDisabled={saving} isLoading={saving} onClick={onOpen}>
{t("components.addFilterDialog.addButton")}
<span>{t("components.addFilterDialog.addButton")}</span>
</Button>
<Modal isOpen={isOpen} onClose={onClose}>
<ModalOverlay />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const AddUserFeedDialog = ({ trigger }: Props) => {
isLoading={isLoading}
variant="solid"
>
{t("features.userFeeds.components.addUserFeedDialog.addButton")}
<span>{t("features.userFeeds.components.addUserFeedDialog.addButton")}</span>
</Button>
)}
</Tooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const SelectableUserFeedList = ({ selectedIds, onSelectedIdsChange }: Pro
size="sm"
width="full"
>
Load more
<span>Load more</span>
</Button>
</Flex>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ export const UserFeedsTable: React.FC<Props> = ({ onSelectedFeedId }) => {
onClick={() => fetchNextPage()}
mb={20}
>
Load More
<span>Load More</span>
</Button>
</Stack>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const CloneDiscordConnectionCloneDialog = ({
Cancel
</Button>
<Button colorScheme="blue" type="submit" form="clonefeed" isLoading={isSubmitting}>
Clone
<span>Clone</span>
</Button>
</HStack>
</ModalFooter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const AddComparisonSelect = ({
minW={32}
isLoading={isAdding || isLoading}
>
Add
<span>Add</span>
</Button>
</Stack>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ export const ComparisonsTabSection = ({
isDisabled={userFeedArticlesFetchStatus === "fetching"}
size="sm"
>
Select article to preview
<span>Select article to preview</span>
</Button>
}
feedId={feedId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export const AddFeedComanagerDialog = ({
isDisabled={!selectedMention || !checkedConnections.length || saving}
isLoading={saving}
>
{okButtonText || t("common.buttons.save")}
<span>{okButtonText || t("common.buttons.save")}</span>
</Button>
</HStack>
</ModalFooter>
Expand Down
2 changes: 1 addition & 1 deletion services/backend-api/client/src/pages/FeedClone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const FeedClone: React.FC = () => {
isDisabled={!selectedFeedId || !properties.length || loadingFeeds || saving}
colorScheme="blue"
>
{t("pages.cloneFeed.cloneButtonLabel")}
<span>{t("pages.cloneFeed.cloneButtonLabel")}</span>
</Button>
</HStack>
</Stack>
Expand Down
7 changes: 4 additions & 3 deletions services/backend-api/client/src/pages/UserSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ const ChangePaymentMethodUrlButton = () => {
isDisabled={!!error}
colorScheme={error ? "red" : undefined}
>
{!error && <span>Change Payment Method</span>}
{error && <span>Failed to load change payment method button</span>}
<span>
{error ? "Failed to load change payment method button" : "Change Payment Method"}
</span>
</Button>
</Box>
);
Expand Down Expand Up @@ -574,7 +575,7 @@ export const UserSettings = () => {
onClickRemoveRedditLogin();
}}
>
Disconnect
<span>Disconnect</span>
</Button>
)}
</HStack>
Expand Down

0 comments on commit 0b98185

Please sign in to comment.