From 5b8aa5bb19889c26bcf51fc8e79ad05b90d5ca03 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 14 Feb 2019 13:42:31 -0500 Subject: [PATCH] Change the popup warning on the metadata editor --- .../homebrew/editor/metadataEditor/metadataEditor.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/metadataEditor/metadataEditor.jsx b/client/homebrew/editor/metadataEditor/metadataEditor.jsx index 5bfbe8027..ac752d466 100644 --- a/client/homebrew/editor/metadataEditor/metadataEditor.jsx +++ b/client/homebrew/editor/metadataEditor/metadataEditor.jsx @@ -42,8 +42,14 @@ const MetadataEditor = createClass({ }, handleDelete : function(){ - if(!confirm('are you sure you want to delete this brew?')) return; - if(!confirm('are you REALLY sure? You will not be able to recover it')) return; + if(this.props.metadata.authors.length <= 1){ + if(!confirm('Are you sure you want to delete this brew? Because you are the only owner of this brew, the document will be deleted permanently.')) return; + if(!confirm('Are you REALLY sure? You will not be able to recover the document.')) return; + } + else{ + if(!confirm('Are you sure you want to remove this brew from your collection? This will remove you as an editor, but other owners will still be able to access the document.')) return; + if(!confirm('Are you REALLY sure? You will lose editor access to this document.')) return; + } request.get(`/api/remove/${this.props.metadata.editId}`) .send()