Files
moreminimore-chat/app/javascript/shared/store/globalConfig.js
Kunthawat Greethong d925ab11e5 [brand] remove dead LOGO_DARK mapping; resize logo_thumbnail to 512x512
Clean up the now-dead LOGO_DARK/logoDark mapping in globalConfig.js
(LOGO_DARK was removed from DashboardController::GLOBAL_CONFIG_KEYS in
rebase phase 1 f17ce89; logoDark was always undefined and no view consumed
it). Produce a proper favicon-sized 512x512 logo_thumbnail.png from the
1000x1000 logo.png instead of the byte-identical copy. No egress, no
functional change outside removing unused state.
2026-08-16 10:02:51 +07:00

80 lines
2.4 KiB
JavaScript

import { parseBoolean } from '@chatwoot/utils';
import { resolveMaximumFileUploadSize } from 'shared/helpers/FileHelper';
const {
API_CHANNEL_NAME: apiChannelName,
API_CHANNEL_THUMBNAIL: apiChannelThumbnail,
APP_VERSION: appVersion,
AZURE_APP_ID: azureAppId,
BRAND_NAME: brandName,
CHATWOOT_INBOX_TOKEN: chatwootInboxToken,
CREATE_NEW_ACCOUNT_FROM_DASHBOARD: createNewAccountFromDashboard,
DIRECT_UPLOADS_ENABLED: directUploadsEnabled,
DISPLAY_MANIFEST: displayManifest,
GIT_SHA: gitSha,
MAXIMUM_FILE_UPLOAD_SIZE: maximumFileUploadSize,
HCAPTCHA_SITE_KEY: hCaptchaSiteKey,
INSTALLATION_NAME: installationName,
LOGO_THUMBNAIL: logoThumbnail,
LOGO: logo,
PRIVACY_URL: privacyURL,
IS_ENTERPRISE: isEnterprise,
TERMS_URL: termsURL,
WIDGET_BRAND_URL: widgetBrandURL,
DISABLE_USER_PROFILE_UPDATE: disableUserProfileUpdate,
DISABLE_META_INBOX_CREATION: disableMetaInboxCreation,
DISABLE_META_MESSAGE_SENDING: disableMetaMessageSending,
DEPLOYMENT_ENV: deploymentEnv,
ACTIVE_PLATFORM_BANNERS: activePlatformBanners,
} = window.globalConfig || {};
const state = {
apiChannelName,
apiChannelThumbnail,
appVersion,
azureAppId,
brandName,
chatwootInboxToken,
deploymentEnv,
createNewAccountFromDashboard,
directUploadsEnabled: parseBoolean(directUploadsEnabled),
disableUserProfileUpdate: parseBoolean(disableUserProfileUpdate),
disableMetaInboxCreation: parseBoolean(disableMetaInboxCreation),
disableMetaMessageSending: parseBoolean(disableMetaMessageSending),
displayManifest,
gitSha,
maximumFileUploadSize: resolveMaximumFileUploadSize(maximumFileUploadSize),
hCaptchaSiteKey,
installationName,
logo,
logoThumbnail,
privacyURL,
termsURL,
widgetBrandURL,
isEnterprise: parseBoolean(isEnterprise),
activePlatformBanners: activePlatformBanners || [],
};
export const getters = {
get: $state => $state,
isOnChatwootCloud: $state => $state.deploymentEnv === 'cloud',
isMetaInboxCreationDisabled: $state =>
$state.deploymentEnv === 'cloud' && $state.disableMetaInboxCreation,
isMetaMessageSendingDisabled: $state =>
$state.deploymentEnv === 'cloud' && $state.disableMetaMessageSending,
isACustomBrandedInstance: $state => $state.installationName !== 'Chatwoot',
isAChatwootInstance: $state => $state.installationName === 'Chatwoot',
};
export const actions = {};
export const mutations = {};
export default {
namespaced: true,
state,
getters,
actions,
mutations,
};