Skip to content

Commit

Permalink
Fix support multiple language
Browse files Browse the repository at this point in the history
  • Loading branch information
lcduong committed Sep 25, 2024
1 parent 046d881 commit 82e834e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions webapp/src/views/schedule/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,19 +156,19 @@ export default {
if (results && results.length) {
founds = self.schedule.talks.filter(t => {
if (refKey === 'session_type') {
if (typeof t.session_type === 'string') {
if (typeof t?.session_type === 'string') {
return selectedIds.includes(t.session_type) && results.includes(t.id)
} else {
} else if (typeof t?.session_type === 'object') {
return Object.keys(t.session_type).some(key => selectedIds.includes(t.session_type[key])) && results.includes(t.id)
}
}
return selectedIds.includes(t[refKey]) && results && results.includes(t.id)})?.map(i => i.id) || []

Check failure on line 165 in webapp/src/views/schedule/index.vue

View workflow job for this annotation

GitHub Actions / build

Requires a space before '}'

Check failure on line 165 in webapp/src/views/schedule/index.vue

View workflow job for this annotation

GitHub Actions / build

Closing curly brace should be on the same line as opening curly brace or on the line after the previous block
} else {
founds = self.schedule.talks.filter(t => {
if (refKey === 'session_type') {
if (typeof t.session_type === 'string') {
if (typeof t?.session_type === 'string') {
return selectedIds.includes(t.session_type)
} else {
} else if (typeof t?.session_type === 'object') {
return Object.keys(t.session_type).some(key => selectedIds.includes(t.session_type[key]))
}
}
Expand Down Expand Up @@ -224,10 +224,10 @@ export default {
const setSessionType = new Set()
const enLanguage = 'en'
this.schedule.session_type.forEach(t => {
if (typeof t.session_type === 'string') {
this.schedule?.session_type.forEach(t => {
if (typeof t?.session_type === 'string') {
setSessionType.add(t.session_type)
} else {
} else if (typeof t?.session_type === 'object') {
const sessionTypeKeyArray = Object.keys(t.session_type)
let isEnglish = false
Expand Down Expand Up @@ -359,9 +359,9 @@ export default {
data.forEach(
t => {
if (typeof t.name === 'string') {
if (typeof t?.name === 'string') {
setMap.set(t.id, t.name)
} else {
} else if (typeof t?.name === 'object') {
const keyArray = Object.keys(t.name)
let isEnglish = false
Expand Down
18 changes: 9 additions & 9 deletions webapp/src/views/schedule/sessions/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,19 @@ export default {
if (results && results.length) {
founds = self.schedule.talks.filter(t => {
if (refKey === 'session_type') {
if (typeof t.session_type === 'string') {
if (typeof t?.session_type === 'string') {
return selectedIds.includes(t.session_type) && results.includes(t.id)
} else {
} else if (typeof t?.session_type === 'object') {
return Object.keys(t.session_type).some(key => selectedIds.includes(t.session_type[key])) && results.includes(t.id)
}
}
return selectedIds.includes(t[refKey]) && results && results.includes(t.id)})?.map(i => i.id) || []

Check failure on line 153 in webapp/src/views/schedule/sessions/index.vue

View workflow job for this annotation

GitHub Actions / build

Requires a space before '}'

Check failure on line 153 in webapp/src/views/schedule/sessions/index.vue

View workflow job for this annotation

GitHub Actions / build

Closing curly brace should be on the same line as opening curly brace or on the line after the previous block
} else {
founds = self.schedule.talks.filter(t => {
if (refKey === 'session_type') {
if (typeof t.session_type === 'string') {
if (typeof t?.session_type === 'string') {
return selectedIds.includes(t.session_type)
} else {
} else if (typeof t?.session_type === 'object') {
return Object.keys(t.session_type).some(key => selectedIds.includes(t.session_type[key]))
}
}
Expand Down Expand Up @@ -212,10 +212,10 @@ export default {
const setSessionType = new Set()
const enLanguage = 'en'
this.schedule.session_type.forEach(t => {
if (typeof t.session_type === 'string') {
this.schedule?.session_type?.forEach(t => {
if (typeof t?.session_type === 'string') {
setSessionType.add(t.session_type)
} else {
} else if (typeof t?.session_type === 'object') {
const sessionTypeKeyArray = Object.keys(t.session_type)
let isEnglish = false
Expand Down Expand Up @@ -347,9 +347,9 @@ export default {
data.forEach(
t => {
if (typeof t.name === 'string') {
if (typeof t?.name === 'string') {
setMap.set(t.id, t.name)
} else {
} else if (typeof t?.name === 'object') {
const keyArray = Object.keys(t.name)
let isEnglish = false
Expand Down

0 comments on commit 82e834e

Please sign in to comment.