mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 00:52:09 +03:00
Fix updating conflicting project (#11111)
This PR fixes a bug, when uploading a duplicate project to local backend threw a crash on windows. https://github.com/user-attachments/assets/fe1bd7a7-d840-4bb1-b3f6-e0beec70fcd4 I found a bug when we upload a project to a remote backend, it throws a 500 error. Notified @PabloBuchu about that. Also, @hubertp proved that the ProjectManager always duplicates a project no matter which option we choose(either "update" or "rename“). So I removed the "update" button if we upload a project locally
This commit is contained in:
parent
3458fe4fe1
commit
239a6803bf
@ -1770,7 +1770,7 @@ export default function AssetsTable(props: AssetsTableProps) {
|
||||
addIdToSelection(projectId)
|
||||
|
||||
await getProjectDetailsMutation
|
||||
.mutateAsync([projectId, asset.parentId, file.name])
|
||||
.mutateAsync([projectId, asset.parentId, asset.title])
|
||||
.catch((error) => {
|
||||
deleteAsset(projectId)
|
||||
toastAndLog('uploadProjectError', error)
|
||||
@ -1887,13 +1887,7 @@ export default function AssetsTable(props: AssetsTableProps) {
|
||||
|
||||
const asset = isUpdating ? conflict.current : conflict.new
|
||||
|
||||
fileMap.set(
|
||||
asset.id,
|
||||
new File([conflict.file], asset.title, {
|
||||
type: conflict.file.type,
|
||||
lastModified: conflict.file.lastModified,
|
||||
}),
|
||||
)
|
||||
fileMap.set(asset.id, conflict.file)
|
||||
|
||||
insertAssets([asset], event.parentId)
|
||||
void doUploadFile(asset, isUpdating ? 'update' : 'new')
|
||||
|
@ -214,6 +214,7 @@ export default function DuplicateAssetsModal(props: DuplicateAssetsModalProps) {
|
||||
>
|
||||
{getText('update')}
|
||||
</ariaComponents.Button>
|
||||
|
||||
<ariaComponents.Button
|
||||
variant="outline"
|
||||
onPress={() => {
|
||||
@ -252,6 +253,7 @@ export default function DuplicateAssetsModal(props: DuplicateAssetsModalProps) {
|
||||
: getText('andOtherProjects', otherProjectsCount)}
|
||||
</aria.Text>
|
||||
)}
|
||||
|
||||
<ariaComponents.ButtonGroup className="relative">
|
||||
<ariaComponents.Button
|
||||
variant="submit"
|
||||
@ -263,6 +265,7 @@ export default function DuplicateAssetsModal(props: DuplicateAssetsModalProps) {
|
||||
>
|
||||
{count === 1 ? getText('update') : getText('updateAll')}
|
||||
</ariaComponents.Button>
|
||||
|
||||
<ariaComponents.Button
|
||||
variant="accent"
|
||||
onPress={() => {
|
||||
|
Loading…
Reference in New Issue
Block a user