mirror of
https://gitee.com/eolink_admin/postcat.git
synced 2024-12-02 11:47:57 +08:00
fix: installed list may be empty
This commit is contained in:
parent
a558094946
commit
e744cbf71e
@ -19,6 +19,7 @@ export class ExtensionService {
|
||||
ignoreList = ['default'];
|
||||
disabledExtensionNames: string[] = this.getDisableExtensionNames();
|
||||
extensionIDs: string[] = [];
|
||||
isFirstInit = true;
|
||||
HOST = APP_CONFIG.EXTENSION_URL;
|
||||
installedList: ExtensionInfo[] = [];
|
||||
installedMap: Map<string, ExtensionInfo> = new Map();
|
||||
@ -94,7 +95,7 @@ export class ExtensionService {
|
||||
return this.installedList.includes(name);
|
||||
}
|
||||
public async requestList(type = 'list', queryParams = {}) {
|
||||
if (type === 'list') {
|
||||
if (type === 'list' && !this.isFirstInit) {
|
||||
this.requestPending?.unsubscribe();
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
@ -143,6 +144,7 @@ export class ExtensionService {
|
||||
|
||||
this.store.setExtensionList(result.data);
|
||||
this.requestPending = null;
|
||||
this.isFirstInit = false;
|
||||
resolve([result, originData]);
|
||||
},
|
||||
error: () => {
|
||||
|
Loading…
Reference in New Issue
Block a user