This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 49442144 Allow for already deleted icla when matching sig
49442144 is described below

commit 4944214419afbcd3128243a7f49e36340d199d07
Author: Sebb <[email protected]>
AuthorDate: Fri Sep 27 23:49:49 2024 +0100

    Allow for already deleted icla when matching sig
---
 www/secretary/workbench/views/check-signature.js.rb | 6 +++---
 www/secretary/workbench/views/parts.js.rb           | 3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/www/secretary/workbench/views/check-signature.js.rb 
b/www/secretary/workbench/views/check-signature.js.rb
index 162c1a16..6730e317 100644
--- a/www/secretary/workbench/views/check-signature.js.rb
+++ b/www/secretary/workbench/views/check-signature.js.rb
@@ -47,7 +47,7 @@ class CheckSignature < Vue
 
   # find signature file that matches the selected attachment from the list
   # of attachments
-  def self.find(selected, attachments)
+  def self.find(selected, attachments, attachCount=2)
     return unless selected
 
     # first look for a signature that matches this selected file
@@ -56,8 +56,8 @@ class CheckSignature < Vue
     }
 
     # if no exact match, look closer at the other attachment if there
-    # are exactly two attachments
-    if not signature and attachments.length == 2
+    # are exactly two attachments (or one if we have already deleted the icla)
+    if not signature and attachments.length == attachCount
       signature = attachments.find {|attachment| attachment != selected}
 
       unless signature.end_with? '.asc' or signature.end_with? '.sig'
diff --git a/www/secretary/workbench/views/parts.js.rb 
b/www/secretary/workbench/views/parts.js.rb
index bccd79ba..9c731bb3 100644
--- a/www/secretary/workbench/views/parts.js.rb
+++ b/www/secretary/workbench/views/parts.js.rb
@@ -591,7 +591,8 @@ class Parts < Vue
     HTTP.post('../../actions/delete-attachment', data).then {|response|
       @attachments = response.attachments
       if event.type == 'message'
-        signature = CheckSignature.find(decodeURIComponent(@selected), 
response.attachments)
+        # we have already deleted the icla, so allow matching a single 
attachment
+        signature = CheckSignature.find(decodeURIComponent(@selected), 
response.attachments, 1)
         @busy = false
         @selected = signature
         self.delete_attachment(event) if signature

Reply via email to