@blocklet/pages-kit 0.6.76 → 0.6.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -197,8 +197,8 @@ export const customComponentStates = () => {
197
197
  if (!instance)
198
198
  return null;
199
199
  const props = instance.locales?.[locale]?.props;
200
- if (!props)
201
- return null;
200
+ // 为了修复频繁触发 /preload 的问题,这里注释掉了如果找不到 props 就返回 null 的逻辑,这个逻辑现在应该是没用的 2025-09-26
201
+ // if (!props) return null;
202
202
  return { component, Component, props, componentProperties: components[componentId]?.component.properties };
203
203
  },
204
204
  async loadComponents(input) {
@@ -285,7 +285,7 @@ const COMPONENT_LOADER_MAP = {};
285
285
  const getRealLocale = (locale) => {
286
286
  const requestLocale = customComponentStates()((s) => s.state.config.supportedLocales?.some((i) => i.locale === locale) ? locale : undefined);
287
287
  const defaultLocale = customComponentStates()((s) => s.state.config.defaultLocale);
288
- return requestLocale || defaultLocale;
288
+ return requestLocale || defaultLocale || 'en';
289
289
  };
290
290
  const getComponentByComponentId = ({ componentId, locale, instanceId, }) => {
291
291
  const realLocale = getRealLocale(locale);