Commit 214b912b authored by 神楽坂玲奈's avatar 神楽坂玲奈

apps service 一些改动,未测试

parent b2bf569f
......@@ -7,7 +7,6 @@ import {DownloadService} from "./download.service";
import {clipboard, remote} from "electron";
import * as path from "path";
import * as fs from 'fs';
import mkdirp = require("mkdirp");
declare const Notification: any;
declare const $: any;
......@@ -32,30 +31,10 @@ export class AppDetailComponent implements OnInit {
private downloadService: DownloadService, private ref: ChangeDetectorRef) {
}
// public File[] listRoots() {
// int ds = listRoots0();
// int n = 0;
// for (int i = 0; i < 26; i++) {
// if (((ds >> i) & 1) != 0) {
// if (!access((char)('A' + i) + ":" + slash))
// ds &= ~(1 << i);
// else
// n++;
// }
// }
// File[] fs = new File[n];
// int j = 0;
// char slash = this.slash;
// for (int i = 0; i < 26; i++) {
// if (((ds >> i) & 1) != 0)
// fs[j++] = new File((char)('A' + i) + ":" + slash);
// }
// return fs;
// }
ngOnInit() {
async ngOnInit() {
let volume = 'A';
for (let i = 0; i < 26; i++) {
new Promise((resolve, reject) => {
await new Promise((resolve, reject) => {
let currentVolume = String.fromCharCode(volume.charCodeAt(0) + i) + ":";
fs.access(currentVolume, (err) => {
if (!err) {
......@@ -64,6 +43,7 @@ export class AppDetailComponent implements OnInit {
this.availableLibraries.push(currentVolume);
}
}
resolve()
})
})
}
......@@ -103,7 +83,6 @@ export class AppDetailComponent implements OnInit {
if (confirm("确认删除?")) {
try {
await this.appsService.uninstall(app);
app.status.status = "init";
} catch (e) {
alert(e);
}
......
......@@ -81,6 +81,11 @@ export class App {
status: AppStatus;
conference: string | undefined;
reset() {
this.status.status = 'init';
this.local = null;
localStorage.removeItem(this.id);
}
isInstalled(): boolean {
return this.status.status != 'init';
}
......
This diff is collapsed.
{
"name": "mycard",
"version": "3.0.0-dev.13",
"version": "3.0.0-dev.14",
"description": "mycard",
"keywords": [],
"author": "zh99998 <zh99998@gmail.com>",
......@@ -34,7 +34,6 @@
"font-awesome": "latest",
"ini": "latest",
"jquery": "latest",
"mkdirp": "latest",
"raw-socket": "latest",
"reflect-metadata": "latest",
"rxjs": "5.0.0-beta.12",
......@@ -53,7 +52,6 @@
"@types/node": "latest",
"@types/electron": "latest",
"@types/ini": "latest",
"@types/mkdirp": "latest"
},
"build": {
"productName": "MyCard",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment