mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-15 17:30:13 +08:00
fix: inconsistent format issue when checking if the plugin is installed (#7493)
* fix: inconsistent format issue when checking if the plugin is installed * Update dashboard/src/views/extension/useExtensionPage.js Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update dashboard/src/views/extension/useExtensionPage.js Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1288,7 +1288,7 @@ export const useExtensionPage = () => {
|
||||
const checkAlreadyInstalled = () => {
|
||||
const data = Array.isArray(extension_data?.data) ? extension_data.data : [];
|
||||
const installedRepos = new Set(data.map((ext) => ext.repo?.toLowerCase()));
|
||||
const installedNames = new Set(data.map((ext) => ext.name));
|
||||
const installedNames = new Set(data.map((ext) => normalizeStr(ext.name).replace(/_/g, '-')));//统一格式,以防下面的匹配不生效
|
||||
const installedByRepo = new Map(
|
||||
data
|
||||
.filter((ext) => ext.repo)
|
||||
@@ -1315,10 +1315,10 @@ export const useExtensionPage = () => {
|
||||
plugin.astrbot_version = matchedInstalled.astrbot_version;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
plugin.installed =
|
||||
installedRepos.has(plugin.repo?.toLowerCase()) ||
|
||||
installedNames.has(plugin.name);
|
||||
installedNames.has(normalizeStr(plugin.name).replace(/_/g, '-'));//统一格式,防止匹配失败
|
||||
}
|
||||
|
||||
let installed = [];
|
||||
|
||||
Reference in New Issue
Block a user