Skip to content

Commit e24e6a2

Browse files
committed
fixup! fix(ts): fix constants type errors
Signed-off-by: Maksim Sukharev <[email protected]>
1 parent b7e3b8f commit e24e6a2

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

src/components/CalendarEventsDialog.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ const isMatch = (string: string = '') => string.toLowerCase().includes(searchTex
160160
const participants = computed(() => {
161161
const conversation: Conversation = store.getters.conversation(props.token)
162162
return store.getters.participantsList(props.token).filter((participant: Participant) => {
163-
return (participant.actorType === ATTENDEE.ACTOR_TYPE.USERS
164-
|| participant.actorType === ATTENDEE.ACTOR_TYPE.EMAILS)
163+
return [ATTENDEE.ACTOR_TYPE.USERS, ATTENDEE.ACTOR_TYPE.EMAILS].includes(participant.actorType)
165164
&& participant.attendeeId !== conversation.attendeeId
166165
})
167166
})

src/services/coreService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ const autocompleteQuery = async function({ searchText, token = 'new', onlyUsers
4343
SHARE.TYPE.USER,
4444
SHARE.TYPE.GROUP,
4545
SHARE.TYPE.CIRCLE,
46-
token !== 'new' ? SHARE.TYPE.EMAIL : null,
47-
canInviteToFederation ? SHARE.TYPE.REMOTE : null,
48-
].filter((type: ShareType | null): type is ShareType => type !== null)
46+
...(token !== 'new' ? [SHARE.TYPE.EMAIL] : []),
47+
...(canInviteToFederation ? [SHARE.TYPE.REMOTE] : []),
48+
]
4949

5050
return axios.get(generateOcsUrl('core/autocomplete/get'), {
5151
...options,

src/types/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ export type JoinRoomFullResponse = {
106106
}
107107

108108
// Participants
109-
export type ActorType = components['schemas']['ActorTypes']
110109
export type ParticipantStatus = {
111110
status?: string | null,
112111
message?: string | null,

src/utils/getDisplayName.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
import { t } from '@nextcloud/l10n'
66

77
import { ATTENDEE } from '../constants.ts'
8-
import type { ActorType } from '../types/index.ts'
98

10-
export const getDisplayNameWithFallback = function(displayName: string, source: ActorType | string): string {
9+
export const getDisplayNameWithFallback = function(displayName: string, source: string): string {
1110
if (displayName?.trim()) {
1211
return displayName.trim()
1312
}
1413

15-
if (source === ATTENDEE.ACTOR_TYPE.GUESTS || source === ATTENDEE.ACTOR_TYPE.EMAILS) {
14+
if ([ATTENDEE.ACTOR_TYPE.GUESTS, ATTENDEE.ACTOR_TYPE.EMAILS].includes(source)) {
1615
return t('spreed', 'Guest')
1716
}
1817

0 commit comments

Comments
 (0)