Commit 530358c9 authored by 神楽坂玲奈's avatar 神楽坂玲奈

Merge branch 'v3' of github.com:mycard/mycard into v3

parents 6dacbd23 da3a1104
......@@ -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 {InstallService} from "./install.service";
import mkdirp = require("mkdirp");
declare const Notification: any;
......@@ -30,8 +29,7 @@ export class AppDetailComponent implements OnInit {
referencesInstall: {[id: string]: boolean};
constructor(private appsService: AppsService, private settingsService: SettingsService,
private downloadService: DownloadService, private installService: InstallService,
private ref: ChangeDetectorRef) {
private downloadService: DownloadService, private ref: ChangeDetectorRef) {
}
// public File[] listRoots() {
......@@ -103,8 +101,12 @@ export class AppDetailComponent implements OnInit {
async uninstall(app: App) {
if (confirm("确认删除?")) {
await this.installService.uninstall(app);
app.status.status = "init";
try {
await this.appsService.uninstall(app);
app.status.status = "init";
} catch (e) {
alert(e);
}
}
}
......@@ -131,7 +133,7 @@ export class AppDetailComponent implements OnInit {
let volume = this.installOption.installLibrary.slice(7);
let library = path.join(volume, "MyCardLibrary");
try {
await this.installService.createDirectory(library);
await this.appsService.createDirectory(library);
this.installOption.installLibrary = library;
this.settingsService.addLibrary(library, true);
} catch (e) {
......
This diff is collapsed.
This diff is collapsed.
......@@ -6,7 +6,6 @@ import {AppsService} from "./apps.service";
import {LoginService} from "./login.service";
import {App, Category} from "./app";
import {DownloadService} from "./download.service";
import {InstallService} from "./install.service";
import {Http, URLSearchParams} from "@angular/http";
import {shell} from "electron";
import WebViewElement = Electron.WebViewElement;
......@@ -25,8 +24,7 @@ export class LobbyComponent implements OnInit {
currentApp: App;
private apps: Map<string,App>;
constructor(private appsService: AppsService, private loginService: LoginService, private downloadService: DownloadService,
private installService: InstallService, private http: Http) {
constructor(private appsService: AppsService, private loginService: LoginService) {
}
async ngOnInit() {
......
......@@ -14,7 +14,6 @@ import {AppsService} from "./apps.service";
import {SettingsService} from "./settings.sevices";
import {LoginService} from "./login.service";
import {DownloadService} from "./download.service";
import {InstallService} from "./install.service";
@NgModule({
imports: [BrowserModule, FormsModule, ReactiveFormsModule, HttpModule],
......@@ -25,7 +24,6 @@ import {InstallService} from "./install.service";
bootstrap: [MyCardComponent],
providers: [
AppsService, SettingsService, LoginService, DownloadService,
InstallService
],
schemas: [NO_ERRORS_SCHEMA]
})
......
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