Skip to content

Commit f499c46

Browse files
committed
fix(minapps): ensure Region selector has default value for upgraded users
- Add migration 194 to initialize minAppRegion setting to auto - Add defensive default value in RegionSelector component Fixes: Region selector showing placeholder instead of default value
1 parent 1f0bba7 commit f499c46

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/renderer/src/pages/minapps/MiniappSettings/MiniAppSettings.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ import MiniAppIconsManager from './MiniAppIconsManager'
2424
// 默认小程序缓存数量
2525
const DEFAULT_MAX_KEEPALIVE = 3
2626

27-
// 地区选择器组件
27+
// Region selector component with defensive default value
2828
const RegionSelector: FC = () => {
2929
const { t } = useTranslation()
3030
const dispatch = useAppDispatch()
31-
const minAppRegion = useAppSelector((state: RootState) => state.settings.minAppRegion)
31+
const minAppRegion = useAppSelector((state: RootState) => state.settings.minAppRegion) ?? 'auto'
3232

3333
const onMinAppRegionChange = (value: MinAppRegionFilter) => {
3434
dispatch(setMinAppRegion(value))

src/renderer/src/store/migrate.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3184,6 +3184,8 @@ const migrateConfig = {
31843184
assistant.defaultModel = qwen3Next80BModel
31853185
}
31863186
})
3187+
// Initialize mini app region filter setting
3188+
state.settings.minAppRegion ??= 'auto'
31873189
return state
31883190
} catch (error) {
31893191
logger.error('migrate 194 error', error as Error)

0 commit comments

Comments
 (0)