whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: set fetched when fetching is done
Date Sun, 02 Oct 2016 01:33:55 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git

The following commit(s) were added to refs/heads/master by this push:
       new  dcaa6e3   set fetched when fetching is done
dcaa6e3 is described below

commit dcaa6e3097921f66af36d757a31a03b13dc01042
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sat Oct 1 21:33:31 2016 -0400

    set fetched when fetching is done
---
 www/secmail/views/index.js.rb | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/www/secmail/views/index.js.rb b/www/secmail/views/index.js.rb
index ecb8ead..ebdac3e 100644
--- a/www/secmail/views/index.js.rb
+++ b/www/secmail/views/index.js.rb
@@ -81,8 +81,14 @@ class Index < React
     today = Date.new()
     twice = (today.getMonth()+1==@nextmbox[4..5].to_i and today.getDate()<=7)
     self.fetch_month() do
-      # for the first week of the month, fetch previous month too
-      self.fetch_month() if @nextmbox and twice
+      if @nextmbox and twice
+        # for the first week of the month, fetch previous month too
+        self.fetch_month() do
+          @fetched = true
+        end
+      else
+        @fetched = true
+      end
     end
 
     window.onkeydown = self.keydown
@@ -122,9 +128,6 @@ class Index < React
   # fetch a month's worth of messages
   def fetch_month(&block)
     HTTP.get(@nextmbox, :json).then {|response|
-      # indicate that (at least one) fetch is complete
-      @fetched = true
-
       # update latest mbox
       @nextmbox = response.mbox
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message