Skip to content

Commit

Permalink
Moved out of the global scope to local scope and refactored into arro…
Browse files Browse the repository at this point in the history
…w functions.
  • Loading branch information
miguelvaara committed Jan 21, 2025
1 parent 279f420 commit 09f7374
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions resource/js/tab-alpha.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,12 @@ function startAlphaApp () {
tabAlphaApp.mount('#tab-alphabetical')
}

function waitForTranslationService () {
const waitForTranslationServiceTabAlpha = () => {
if (typeof $t !== 'undefined') {
startAlphaApp()
} else {
setTimeout(waitForTranslationService, 50)
setTimeout(waitForTranslationServiceTabAlpha, 50)
}
}

waitForTranslationService()
waitForTranslationServiceTabAlpha()
6 changes: 3 additions & 3 deletions resource/js/vocab-counts.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ function startResourceCountsApp () {
resourceCountsApp.mount('#resource-counts')
}

function waitForTranslationService () {
const waitForTranslationServiceVocabCounts = () => {
if (typeof $t !== 'undefined') {
startResourceCountsApp()
} else {
setTimeout(waitForTranslationService, 50)
setTimeout(waitForTranslationServiceVocabCounts, 50)
}
}

waitForTranslationService()
waitForTranslationServiceVocabCounts()
6 changes: 3 additions & 3 deletions resource/js/vocab-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,12 @@ function startVocabSearchApp () {
vocabSearch.mount('#search-vocab')
}

function waitForTranslationService () {
const waitForTranslationServiceVocabSearch = () => {
if (typeof $t !== 'undefined') {
startVocabSearchApp()
} else {
setTimeout(waitForTranslationService, 50)
setTimeout(waitForTranslationServiceVocabSearch, 50)
}
}

waitForTranslationService()
waitForTranslationServiceVocabSearch()

0 comments on commit 09f7374

Please sign in to comment.