fix uninstall bug in market place

This commit is contained in:
Xuan Sang LE 2018-03-08 23:29:37 +01:00
parent c82da84240
commit 318f26d164

View File

@ -96,7 +96,6 @@ class MarketPlace extends this.OS.GUI.BaseApplication
me.installFile app.className, zip, files, () -> me.installFile app.className, zip, files, () ->
zip.file("package.json").async("string").then (d) -> zip.file("package.json").async("string").then (d) ->
v = JSON.parse d v = JSON.parse d
console.log v
v.text = v.name v.text = v.name
v.filename = app.className v.filename = app.className
v.type = "app" v.type = "app"
@ -114,9 +113,9 @@ class MarketPlace extends this.OS.GUI.BaseApplication
return me.error "Cannot down load the app #{err}" if err return me.error "Cannot down load the app #{err}" if err
uninstall: (e) -> uninstall: (e) ->
me = @ me = @
app = @applist.get "selected" sel = @applist.get "selected"
name = app.className name = sel.className
return unless app return unless sel
app = @systemsetting.system.packages[app.className] app = @systemsetting.system.packages[app.className]
return unless app return unless app
@openDialog "YesNoDialog", @openDialog "YesNoDialog",
@ -127,7 +126,7 @@ class MarketPlace extends this.OS.GUI.BaseApplication
me.notify "Package uninstalled" me.notify "Package uninstalled"
me.systemsetting.system.packages[name] = undefined me.systemsetting.system.packages[name] = undefined
me._gui.refreshSystemMenu() me._gui.refreshSystemMenu()
me.appDetail app me.appDetail sel
, "Uninstall" , , "Uninstall" ,
{ text: "Uninstall : #{app.name} ?" } { text: "Uninstall : #{app.name} ?" }
mkdirs: (n, list, f) -> mkdirs: (n, list, f) ->