Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

utils.ts 591B

1234567891011121314151617181920212223
  1. import { IS_CE_EDITION } from '@/config'
  2. export type ConversationField = {
  3. id: string,
  4. value: any,
  5. }
  6. declare global {
  7. // eslint-disable-next-line ts/consistent-type-definitions
  8. interface Window {
  9. zE?: (
  10. command: string,
  11. value: string,
  12. payload?: ConversationField[] | string | string[] | (() => any),
  13. callback?: () => any,
  14. ) => void;
  15. }
  16. }
  17. export const setZendeskConversationFields = (fields: ConversationField[], callback?: () => any) => {
  18. if (!IS_CE_EDITION && window.zE)
  19. window.zE('messenger:set', 'conversationFields', fields, callback)
  20. }