fix: fix duplicate app lose custom image (#19775)
This commit is contained in:
parent
b2ae46b80f
commit
618981f1ae
5 changed files with 19 additions and 7 deletions
|
|
@ -111,14 +111,16 @@ const AppCard = ({ app, onRefresh }: AppCardProps) => {
|
|||
}
|
||||
}, [app.id, mutateApps, notify, onRefresh, t])
|
||||
|
||||
const onCopy: DuplicateAppModalProps['onConfirm'] = async ({ name, icon_type, icon, icon_background }) => {
|
||||
const onCopy: DuplicateAppModalProps['onConfirm'] = async ({ name, icon_type, icon, icon_background, icon_url }) => {
|
||||
try {
|
||||
console.log('icon_url', icon_url)
|
||||
const newApp = await copyApp({
|
||||
appID: app.id,
|
||||
name,
|
||||
icon_type,
|
||||
icon,
|
||||
icon_background,
|
||||
icon_url,
|
||||
mode: app.mode,
|
||||
})
|
||||
setShowDuplicateModal(false)
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ export type DuplicateAppModalProps = {
|
|||
onConfirm: (info: {
|
||||
name: string
|
||||
icon_type: AppIconType
|
||||
icon_url?: string | null
|
||||
icon: string
|
||||
icon_background?: string | null
|
||||
}) => Promise<void>
|
||||
|
|
@ -63,6 +64,7 @@ const DuplicateAppModal = ({
|
|||
name,
|
||||
icon_type: appIcon.type,
|
||||
icon: appIcon.type === 'emoji' ? appIcon.icon : appIcon.fileId,
|
||||
icon_url: appIcon.type === 'image' ? appIcon.url : undefined,
|
||||
icon_background: appIcon.type === 'emoji' ? appIcon.background : undefined,
|
||||
})
|
||||
onHide()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue