-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
75 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
export { Voice } from './internal/Voice.class.js'; | ||
export { | ||
getJoinableStateStatus, | ||
JOINABLE_STATE_STATUS, | ||
} from './internal/funcs/getJoinableStateStatus/index.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/features/core/internal/Voice/internal/funcs/checkJoinable/index.ts
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
src/features/core/internal/Voice/internal/funcs/checkJoinable/internal/checkJoinable.func.ts
This file was deleted.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
src/features/core/internal/Voice/internal/funcs/getJoinableStateStatus/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { getJoinableStateStatus } from './internal/getJoinableStateStatus.func.js'; | ||
export { JOINABLE_STATE_STATUS } from './internal/getJoinableStateStatus.constants.js'; |
4 changes: 2 additions & 2 deletions
4
...nable/internal/checkJoinable.constants.ts → ...ernal/getJoinableStateStatus.constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export const JOINABLE_TYPE_MAP = { | ||
export const JOINABLE_STATE_STATUS = { | ||
JOINABLE: 'JOINABLE', | ||
NOT_JOINABLE: 'NOT_JOINABLE', | ||
NOT_FOUND: 'NOT_FOUND', | ||
NOT_VIEWABLE: 'NOT_VIEWABLE', | ||
ALREADY_JOINED: 'ALREADY_JOINED', | ||
} as const; | ||
} as const satisfies Record<string, string>; |
19 changes: 19 additions & 0 deletions
19
...ernal/Voice/internal/funcs/getJoinableStateStatus/internal/getJoinableStateStatus.func.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { isNil, type VoiceBasedChannel } from '@/features/library/index.js'; | ||
|
||
import { JOINABLE_STATE_STATUS } from './getJoinableStateStatus.constants.js'; | ||
|
||
export const getJoinableStateStatus = ({ | ||
channel, | ||
}: { | ||
channel: VoiceBasedChannel | null; | ||
}): (typeof JOINABLE_STATE_STATUS)[keyof typeof JOINABLE_STATE_STATUS] => { | ||
if (isNil(channel)) { | ||
return JOINABLE_STATE_STATUS.NOT_FOUND; | ||
} else if (!channel.joinable) { | ||
return JOINABLE_STATE_STATUS.NOT_JOINABLE; | ||
} else if (!channel.viewable) { | ||
return JOINABLE_STATE_STATUS.NOT_VIEWABLE; | ||
} else { | ||
return JOINABLE_STATE_STATUS.JOINABLE; | ||
} | ||
}; |
12 changes: 6 additions & 6 deletions
12
...ckJoinable/internal/checkJoinable.spec.ts → ...s/internal/getJoinableStateStatus.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters