mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-09-20 13:40:11 +08:00
fix: 标签优先显示策略 auto 模式按服务端优先级配置展示
- auto 模式用合并应用自身(含 sparkApp/apmApp)匹配 priority-config.json, 不再仅取单一子版,避免漏匹配。 - openDetail 区分「已安装页显式来源强制」与「其他页面按策略」; 非强制分支清除 forceViewingOrigin 粘性标志,避免跨入口状态泄漏。 - AppDetailModal 按 TagPriorityStrategy 响应式重算默认来源; 手动切标签仅本次会话预览,不持久。 - storeConfig.loadPriorityConfig 改用 axios(与渲染进程一致), 修复 Electron 下全局 fetch 失败导致配置为空、auto 全部回退 APM 的问题。 - 首页推荐列表 parseAppList 从 jsonUrl 提取分类,避免 category 误为 unknown。
This commit is contained in:
+7
-11
@@ -308,21 +308,17 @@ function getWindowStatePath(): string {
|
||||
|
||||
// 校验保存的窗口位置是否至少部分落在某个显示器可见区域内,避免窗口跑到屏幕外
|
||||
function isVisible(bounds: WindowState): boolean {
|
||||
if (
|
||||
bounds.width === undefined ||
|
||||
bounds.height === undefined ||
|
||||
bounds.x === undefined ||
|
||||
bounds.y === undefined
|
||||
) {
|
||||
// 解构为局部常量后,控制流收窄(const 不可变)可穿透到下方嵌套闭包,
|
||||
// 消除 x/y/width/height 的 “可能为未定义” 告警
|
||||
const { x, y, width, height } = bounds;
|
||||
if (x === undefined || y === undefined || width === undefined || height === undefined) {
|
||||
return false;
|
||||
}
|
||||
const displays = screen.getAllDisplays();
|
||||
return displays.some((display) => {
|
||||
const { x, y, width, height } = display.workArea;
|
||||
const horizontally =
|
||||
bounds.x < x + width && bounds.x + bounds.width > x;
|
||||
const vertically =
|
||||
bounds.y < y + height && bounds.y + bounds.height > y;
|
||||
const w = display.workArea;
|
||||
const horizontally = x < w.x + w.width && x + width > w.x;
|
||||
const vertically = y < w.y + w.height && y + height > w.y;
|
||||
return horizontally && vertically;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user