From 472f02ba15a0eea84a5800fd414e2cadfe7c766e Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Tue, 11 Apr 2023 10:48:07 +0800 Subject: [PATCH] refactor(nocodb): adopt getList new format in Plugin.ts --- packages/nocodb/src/lib/models/Plugin.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/lib/models/Plugin.ts b/packages/nocodb/src/lib/models/Plugin.ts index 5d88dc529e..46b322ac5a 100644 --- a/packages/nocodb/src/lib/models/Plugin.ts +++ b/packages/nocodb/src/lib/models/Plugin.ts @@ -43,8 +43,10 @@ export default class Plugin implements PluginType { } static async list(ncMeta = Noco.ncMeta) { - let pluginList = await NocoCache.getList(CacheScope.PLUGIN, []); - if (!pluginList.length) { + const cachedList = await NocoCache.getList(CacheScope.PLUGIN, []); + let { list: pluginList } = cachedList; + const { isEmptyList } = cachedList; + if (!isEmptyList && !pluginList.length) { pluginList = await ncMeta.metaList2(null, null, MetaTable.PLUGIN); await NocoCache.setList(CacheScope.PLUGIN, [], pluginList); }