2024-01-24 00:41:15 +08:00
|
|
|
import PollService from '/imports/ui/components/poll/service';
|
|
|
|
import AudioService from '/imports/ui/components/audio/service';
|
|
|
|
import { isPollingEnabled } from '/imports/ui/services/features';
|
|
|
|
|
2024-01-12 00:51:51 +08:00
|
|
|
const MAX_CHAR_LENGTH = 5;
|
2024-03-22 03:41:32 +08:00
|
|
|
const APP_CONFIG = window.meetingClientSettings.public.app;
|
2024-01-12 00:51:51 +08:00
|
|
|
|
|
|
|
export const shouldStackOptions = (keys: Array<string>) => keys.some((k) => k.length > MAX_CHAR_LENGTH);
|
|
|
|
|
2024-01-24 00:41:15 +08:00
|
|
|
const playAlert = () => AudioService.playAlertSound(
|
|
|
|
`${APP_CONFIG.cdn + APP_CONFIG.basename + APP_CONFIG.instanceId}/resources/sounds/Poll.mp3`,
|
|
|
|
);
|
|
|
|
|
|
|
|
export default {
|
|
|
|
shouldStackOptions,
|
|
|
|
pollAnswerIds: PollService.pollAnswerIds,
|
|
|
|
pollTypes: PollService.pollTypes,
|
|
|
|
isDefaultPoll: PollService.isDefaultPoll,
|
|
|
|
playAlert,
|
|
|
|
isPollingEnabled,
|
|
|
|
};
|