Files
chatwoot/app/javascript/dashboard/components-next/message/useGallery.js
2025-05-16 22:01:16 +05:30

24 lines
487 B
JavaScript

import { computed } from 'vue';
import { useToggle } from '@vueuse/core';
export function useGallery() {
const [showGallery] = useToggle(false);
const isGalleryAllowed = computed(() => {
// eslint-disable-next-line no-underscore-dangle
return !window.__WOOT_ISOLATED_SHELL__;
});
const toggleGallery = value => {
if (!isGalleryAllowed.value) return;
showGallery.value = value;
};
return {
showGallery,
isGalleryAllowed,
toggleGallery,
};
}