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

apps service 一些改动,未测试

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