Skip to content

Commit

Permalink
fix: allow empty text
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsuk1ko committed Oct 28, 2024
1 parent e77ce55 commit 1006382
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/ceobeCanteen.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import { computed, inject } from 'vue';
export const useCeobeApiUtils = () => {
const isLocaleZH = computed(() => inject('getRoot')?.()?.$root.localeZH);

/**
* @returns {string}
*/
const getLocalizedText = obj =>
obj[isLocaleZH.value ? 'zh_CN' : 'en_US'] || obj.zh_CN || obj.en_US || '';
obj[isLocaleZH.value ? 'zh_CN' : 'en_US'] ?? obj.zh_CN ?? obj.en_US ?? '';

return {
isLocaleZH,
Expand Down

0 comments on commit 1006382

Please sign in to comment.