fix: install plugins permissions (#18870)

This commit is contained in:
zxhlyh
2025-04-27 14:00:35 +08:00
committed by GitHub
parent bed47dffb9
commit 58a929edd5
3 changed files with 28 additions and 3 deletions

View File

@@ -144,10 +144,18 @@ const PluginPage = ({
return activeTab === PLUGIN_PAGE_TABS_MAP.marketplace || values.includes(activeTab)
}, [activeTab])
const handleFileChange = (file: File | null) => {
if (!file || !file.name.endsWith('.difypkg')) {
setCurrentFile(null)
return
}
setCurrentFile(file)
}
const uploaderProps = useUploader({
onFileChange: setCurrentFile,
onFileChange: handleFileChange,
containerRef,
enabled: isPluginsTab,
enabled: isPluginsTab && canManagement,
})
const { dragging, fileUploader, fileChangeHandle, removeFile } = uploaderProps