Browse Source

don't launch search if upload failed

Sebastian Bittrich 2 years ago
parent
commit
a3454cca07
2 changed files with 10 additions and 1 deletions
  1. 1 1
      package.json
  2. 9 0
      src/viewer/ui/strucmotif.tsx

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
     "name": "@rcsb/rcsb-molstar",
     "name": "@rcsb/rcsb-molstar",
-    "version": "2.6.0-dev.6",
+    "version": "2.5.11",
     "description": "RCSB PDB apps and props based on Mol*.",
     "description": "RCSB PDB apps and props based on Mol*.",
     "homepage": "https://github.com/molstar/rcsb-molstar#readme",
     "homepage": "https://github.com/molstar/rcsb-molstar#readme",
     "repository": {
     "repository": {

+ 9 - 0
src/viewer/ui/strucmotif.tsx

@@ -120,6 +120,10 @@ class SubmitControls extends PurePluginUIComponent<{}, { isBusy: boolean, residu
             case 'url':
             case 'url':
                 if (format === 'pdb') {
                 if (format === 'pdb') {
                     const uploadUrl = await uploadStructure(ctx);
                     const uploadUrl = await uploadStructure(ctx);
+                    if (!uploadUrl) {
+                        alert('File upload failed!');
+                        return;
+                    }
                     Object.assign(query.parameters.value, { url: uploadUrl, format: 'bcif' });
                     Object.assign(query.parameters.value, { url: uploadUrl, format: 'bcif' });
                 } else {
                 } else {
                     Object.assign(query.parameters.value, { url, format });
                     Object.assign(query.parameters.value, { url, format });
@@ -127,6 +131,11 @@ class SubmitControls extends PurePluginUIComponent<{}, { isBusy: boolean, residu
                 break;
                 break;
             case 'file':
             case 'file':
                 const uploadUrl = await uploadStructure(ctx);
                 const uploadUrl = await uploadStructure(ctx);
+                alert('Motifs can only be extracted from a single model!');
+                if (!uploadUrl) {
+                    alert('File upload failed!');
+                    return;
+                }
                 Object.assign(query.parameters.value, { url: uploadUrl, format: 'bcif' });
                 Object.assign(query.parameters.value, { url: uploadUrl, format: 'bcif' });
                 break;
                 break;
         }
         }