mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-26 01:10:16 +08:00
feat(应用详情): 增强应用详情页功能并优化代码格式
重构应用详情页逻辑,支持从首页和深度链接直接打开应用时自动获取完整信息 优化应用卡片来源标识显示,支持同时显示多个来源 统一代码格式,修复多行字符串和模板字符串的换行问题
This commit is contained in:
@@ -480,9 +480,7 @@ async function processNextInQueue() {
|
||||
) {
|
||||
clearInterval(timeoutChecker);
|
||||
child.kill();
|
||||
reject(
|
||||
new Error(`下载卡在0%超过 ${currentTimeout / 1000} 秒`),
|
||||
);
|
||||
reject(new Error(`下载卡在0%超过 ${currentTimeout / 1000} 秒`));
|
||||
}
|
||||
}, progressCheckInterval);
|
||||
|
||||
@@ -527,7 +525,9 @@ async function processNextInQueue() {
|
||||
} catch (err) {
|
||||
retryCount++;
|
||||
if (retryCount >= timeoutList.length) {
|
||||
throw new Error(`下载失败,已重试 ${timeoutList.length} 次: ${err}`);
|
||||
throw new Error(
|
||||
`下载失败,已重试 ${timeoutList.length} 次: ${err}`,
|
||||
);
|
||||
}
|
||||
sendLog(`下载失败,准备重试 (${retryCount}/${timeoutList.length})`);
|
||||
// 等待2秒后重试
|
||||
@@ -860,7 +860,9 @@ ipcMain.handle("list-installed", async () => {
|
||||
if (hasEntries) {
|
||||
try {
|
||||
const desktopFiles = fs.readdirSync(entriesPath);
|
||||
logger.debug(`Found desktop files for ${pkgname}: ${desktopFiles.join(", ")}`);
|
||||
logger.debug(
|
||||
`Found desktop files for ${pkgname}: ${desktopFiles.join(", ")}`,
|
||||
);
|
||||
for (const file of desktopFiles) {
|
||||
if (file.endsWith(".desktop")) {
|
||||
const desktopPath = path.join(entriesPath, file);
|
||||
@@ -870,7 +872,9 @@ ipcMain.handle("list-installed", async () => {
|
||||
const iconMatch = content.match(/^Icon=(.+)$/m);
|
||||
if (nameMatch) appName = nameMatch[1].trim();
|
||||
if (iconMatch) icon = iconMatch[1].trim();
|
||||
logger.debug(`Parsed desktop file for ${pkgname}: name=${appName}, icon=${icon}`);
|
||||
logger.debug(
|
||||
`Parsed desktop file for ${pkgname}: name=${appName}, icon=${icon}`,
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user