feat: install-locally button, log delete result

This commit is contained in:
2026-08-17 20:05:39 +08:00
parent 5901ce98e2
commit 2e0e1d5d47
2 changed files with 9 additions and 2 deletions
@@ -114,6 +114,13 @@ async function showWebAppMenu(app, x, y) {
bridge.call('deleteLocalPackage', app.id).then(() => refreshList()).catch(() => {});
});
}
// 安装到本地(本地无包 + 云端有离线包:预下载到本地,不打开)
// Install locally (no local package + cloud offline package: pre-download without opening)
if (!hasLocal && app.offline) {
addItem('安装到本地', () => {
bridge.call('updateOfflinePackage', app.id).then(() => refreshList()).catch(() => {});
});
}
// 导入
addItem('导入离线包', () => {
bridge.call('importOfflinePackage', app.id).catch(() => {});
@@ -52,8 +52,8 @@ class WebAppStorage(private val context: Context) {
// 删除本地离线包
// Delete the local offline package
fun deleteLocalPackage(id: String) {
appDir(id).deleteRecursively()
Log.d(TAG, "deleteLocalPackage: id=$id")
val deleted = appDir(id).deleteRecursively()
Log.d(TAG, "deleteLocalPackage: id=$id deleted=$deleted")
}
// 下载并解压离线包(记录版本号),onProgress 回调 0-100