diff --git a/web/service/use-plugins.ts b/web/service/use-plugins.ts index 6e14d039ab..fd5fa936e7 100644 --- a/web/service/use-plugins.ts +++ b/web/service/use-plugins.ts @@ -128,12 +128,24 @@ export const useInstallFromMarketplaceAndGitHub = ({ try { if (item.type === 'github') { const data = item as GitHubItemAndMarketPlaceDependency + let pluginId = '' + // From local bundle don't have data.value.github_plugin_unique_identifier + if (!data.value.github_plugin_unique_identifier) { + const { unique_identifier } = await post('/workspaces/current/plugin/upload/github', { + body: { + repo: data.value.repo!, + version: data.value.release! || data.value.version!, + package: data.value.packages! || data.value.package!, + }, + }) + pluginId = unique_identifier + } await post('/workspaces/current/plugin/install/github', { body: { repo: data.value.repo!, version: data.value.release! || data.value.version!, package: data.value.packages! || data.value.package!, - plugin_unique_identifier: data.value.github_plugin_unique_identifier!, + plugin_unique_identifier: data.value.github_plugin_unique_identifier! || pluginId, }, }) }