Fix: Update stateWord logic in Activity component for better handling of state strings

- Modified the logic for determining stateWord to ensure it correctly handles cases where the state string has fewer than two words, defaulting to 'secret' when necessary.
This commit is contained in:
2025-04-06 23:04:54 +02:00
parent 7f35fbd540
commit 7ffa35eb13

View File

@@ -50,7 +50,7 @@ const getActivity = computed(() => {
.replace('Workspace:', '')
.trim()
: ''
const stateWord = state.split(' ')[1] || t('secret')
const stateWord = state.split(' ').length >= 2 ? state.split(' ')[1] : t('secret')
const ago = useTimeAgo(timestamps.start, {
messages: activityMessages[locale.value] as UseTimeAgoMessages,
}).value