Some refactoring.

This commit is contained in:
John Livingston
2024-06-06 10:26:39 +02:00
parent 5c87eef915
commit aa9697074a
4 changed files with 13 additions and 4 deletions

View File

@ -60,6 +60,9 @@ export class TranslationDirective extends AsyncDirective {
}
private readonly _asyncUpdateTranslation = async (): Promise<true> => {
if (!this._peertubeHelpers) {
console.error('Translation directive: missing peertubeHelpers')
}
const newValue = await this._peertubeHelpers?.translate(this._localizationId) ?? ''
if (newValue !== '' && newValue !== this._translatedValue) {