@100mslive/roomkit-react 0.1.9-alpha.1 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-4JC65BAY.js → HLSView-VGJ2XUDT.js} +3 -3
- package/dist/Prebuilt/components/hooks/useRedirectToLeave.d.ts +1 -1
- package/dist/{VirtualBackground-MIRXD2HZ.js → VirtualBackground-2VZVBRIC.js} +2 -2
- package/dist/{chunk-322YFA55.js → chunk-EDGWHFCM.js} +45 -36
- package/dist/chunk-EDGWHFCM.js.map +7 -0
- package/dist/{chunk-6UGU3UJL.js → chunk-SONHO3VM.js} +2 -2
- package/dist/{chunk-6UGU3UJL.js.map → chunk-SONHO3VM.js.map} +1 -1
- package/dist/index.cjs.js +48 -38
- package/dist/index.cjs.js.map +3 -3
- package/dist/index.js +2 -2
- package/dist/meta.cjs.json +36 -21
- package/dist/meta.esbuild.json +55 -40
- package/package.json +6 -6
- package/src/Prebuilt/AppStateContext.tsx +3 -4
- package/src/Prebuilt/components/AppData/useSidepane.js +5 -4
- package/src/Prebuilt/components/Leave/LeaveRoom.tsx +5 -3
- package/src/Prebuilt/components/MwebLandscapePrompt.tsx +10 -4
- package/src/Prebuilt/components/Notifications/Notifications.tsx +1 -1
- package/src/Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.jsx +5 -1
- package/src/Prebuilt/components/Polls/CreateQuestions/QuestionForm.jsx +6 -2
- package/src/Prebuilt/components/Polls/Voting/Voting.jsx +1 -1
- package/src/Prebuilt/components/hooks/useRedirectToLeave.tsx +5 -8
- package/dist/chunk-322YFA55.js.map +0 -7
- /package/dist/{HLSView-4JC65BAY.js.map → HLSView-VGJ2XUDT.js.map} +0 -0
- /package/dist/{VirtualBackground-MIRXD2HZ.js.map → VirtualBackground-2VZVBRIC.js.map} +0 -0
@@ -146,7 +146,7 @@ export function Notifications() {
|
|
146
146
|
|
147
147
|
case HMSNotificationTypes.POLL_STARTED:
|
148
148
|
if (notification.data.startedBy !== localPeerID) {
|
149
|
-
const pollStartedBy = vanillaStore.getState(selectPeerNameByID(notification.data.startedBy));
|
149
|
+
const pollStartedBy = vanillaStore.getState(selectPeerNameByID(notification.data.startedBy)) || 'Participant';
|
150
150
|
ToastManager.addToast({
|
151
151
|
title: `${pollStartedBy} started a ${notification.data.type}: ${notification.data.title}`,
|
152
152
|
action: (
|
@@ -172,7 +172,11 @@ const AddMenu = () => {
|
|
172
172
|
};
|
173
173
|
|
174
174
|
const PrevMenu = () => {
|
175
|
-
|
175
|
+
// filter polls that have been started or stopped sorted by when they were created and their live state
|
176
|
+
const polls = useHMSStore(selectPolls)
|
177
|
+
?.filter(poll => poll.state === 'started' || poll.state === 'stopped')
|
178
|
+
.sort((a, b) => (b.createdAt?.getTime() || 0) - (a.createdAt?.getTime() || 0))
|
179
|
+
.sort((a, b) => (b.state === 'started' ? 1 : 0) - (a.state === 'started' ? 1 : 0));
|
176
180
|
return polls?.length ? (
|
177
181
|
<Flex
|
178
182
|
css={{
|
@@ -204,7 +204,11 @@ export const QuestionForm = ({ question, index, length, onSave, removeQuestion,
|
|
204
204
|
</Box>
|
205
205
|
<Tooltip
|
206
206
|
disabled={isValid}
|
207
|
-
title={
|
207
|
+
title={
|
208
|
+
options.length === 0
|
209
|
+
? 'At least one option is required for a question'
|
210
|
+
: `Please fill all the fields ${isQuiz ? 'and mark the correct answer(s)' : ''} to continue`
|
211
|
+
}
|
208
212
|
boxCss={{ maxWidth: '$40' }}
|
209
213
|
>
|
210
214
|
<Button
|
@@ -240,7 +244,7 @@ export const isValidQuestion = ({ text, type, options, isQuiz = false }) => {
|
|
240
244
|
return true;
|
241
245
|
}
|
242
246
|
|
243
|
-
const everyOptionHasText = options.every(option => option && isValidTextInput(option.text, 1));
|
247
|
+
const everyOptionHasText = options.length > 0 && options.every(option => option && isValidTextInput(option.text, 1));
|
244
248
|
const hasCorrectAnswer = options.some(option => option.isCorrectAnswer);
|
245
249
|
|
246
250
|
if (!isQuiz) {
|
@@ -65,7 +65,7 @@ export const Voting = ({ id, toggleVoting }) => {
|
|
65
65
|
</Box>
|
66
66
|
</Flex>
|
67
67
|
|
68
|
-
<Flex direction="column" css={{ p: '$8 $10' }}>
|
68
|
+
<Flex direction="column" css={{ p: '$8 $10', overflowY: 'auto' }}>
|
69
69
|
<Flex align="center">
|
70
70
|
<Box css={{ flex: 'auto' }}>
|
71
71
|
<Text css={{ color: '$on_surface_medium', fontWeight: '$semiBold' }}>
|
@@ -10,14 +10,11 @@ export const useRedirectToLeave = () => {
|
|
10
10
|
|
11
11
|
const redirect = useCallback(
|
12
12
|
(timeout = 0) => {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
resolve();
|
19
|
-
}, timeout);
|
20
|
-
});
|
13
|
+
setTimeout(() => {
|
14
|
+
PictureInPicture.stop().catch(() => console.error('stopping pip'));
|
15
|
+
ToastManager.clearAllToast();
|
16
|
+
onLeave?.();
|
17
|
+
}, timeout);
|
21
18
|
},
|
22
19
|
[onLeave],
|
23
20
|
);
|