Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

fix(UI): hide Translate Post button if a translation API endpoint isn't specified #50

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composables/masto/translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function useTranslation(status: mastodon.v1.Status | mastodon.v1.StatusEd
&& supportedTranslationCodes.includes(to as any)
&& supportedTranslationCodes.includes(status.language as any)
&& !userSettings.value.disabledTranslationLanguages.includes(status.language)
const enabled = /*! !useRuntimeConfig().public.translateApi && */ shouldTranslate

Choose a reason for hiding this comment

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

I'm very interested in why this was just a single ! before lol

Copy link
Author

Choose a reason for hiding this comment

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

@jpezninjo oh lol yeah I was wondering that too; but if you look closer the second ! is there right after the /*. How it got there,, i don't know.

Choose a reason for hiding this comment

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

Ah that makes complete sense. Good eye!

const enabled = !!useRuntimeConfig().public.translateApi && shouldTranslate

async function toggle() {
if (!shouldTranslate)
Expand Down
Loading