whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [2/2] Commit 06655fd: prep for live updates
Date Tue, 12 Jan 2016 19:22:28 GMT
Commit 06655fdf4692cbe8774115cefdde64c2637773e0:
    prep for live updates


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
www/secmail/views/index.js.rb                                | ++++ ---
------------------------------------------------------------
7 changes: 4 additions, 3 deletions.
------------------------------------------------------------


diff --git a/www/secmail/views/index.js.rb b/www/secmail/views/index.js.rb
index e1cd53b..d0e0dba 100644
--- a/www/secmail/views/index.js.rb
+++ b/www/secmail/views/index.js.rb
@@ -115,7 +115,7 @@ def merge(messages)
       if index == -1
         @messages << new_message
       elsif @messages[index].hash == new_message.hash
-        @messages[index] = @new_message
+        @messages[index] = new_message
       else
         @messages.splice index, 0, new_message
       end
@@ -174,8 +174,9 @@ def undo(event)
 
   def refresh(event)
     @checking = true
-    HTTP.post("actions/check-mail", mbox: @@mbox).then {
-      location.reload()
+    HTTP.post("actions/check-mail", mbox: @@mbox).then {|response|
+      self.merge response.messages
+      @checking = false
     }.catch {|error|
       alert error
       @checking = false

Mime
View raw message