Fix an issue not waitinfg for addon sync to finish.

This commit is contained in:
john liddell
2020-10-06 22:47:52 -05:00
parent df54f4eeb6
commit 9840e9fe89
4 changed files with 8 additions and 3 deletions

View File

@@ -48,7 +48,7 @@ export class MyAddonsListItem {
return AddonDisplayState.Install;
}
if (this.addon.installedVersion != this.addon.latestVersion) {
if (this.addon.installedVersion !== this.addon.latestVersion) {
return AddonDisplayState.Update;
}
@@ -65,7 +65,6 @@ export class MyAddonsListItem {
}
public onClicked() {
console.log(this.addon.name);
this.selected = !this.selected;
}
@@ -79,6 +78,7 @@ export class MyAddonsListItem {
case AddonDisplayState.Install:
case AddonDisplayState.Unknown:
default:
console.log('Unhandled display state', this.displayState)
return '';
}
}

View File

@@ -374,6 +374,7 @@ export class MyAddonsComponent implements OnInit, OnDestroy {
});
},
error: (err) => {
console.error(err);
this.isBusy = false;
this.enableControls = true;
}

View File

@@ -306,7 +306,7 @@ export class AddonService {
this.updateAddons(addons, newAddons);
}
this.syncAddons(clientType, addons);
await this.syncAddons(clientType, addons);
return addons;
}

View File

@@ -167,6 +167,10 @@ export class WarcraftService {
public async listAddons(clientType: WowClientType) {
const addonFolders: AddonFolder[] = [];
if (clientType === WowClientType.None) {
return addonFolders;
}
const addonFolderPath = this.getAddonFolderPath(clientType);
// Folder may not exist if no addons have been installed