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