File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -39,18 +39,20 @@ def render
3939 end
4040 end
4141
42- _input . btn . btn_primary type : 'submit' , value : 'fetch previous month' ,
43- onClick : self . fetch_month
42+ if @nextmbox
43+ _input . btn . btn_primary type : 'submit' , value : 'fetch previous month' ,
44+ onClick : self . fetch_month
45+ end
4446
4547 unless @undoStack . empty?
4648 _input . btn . btn_info type : 'submit' , value : 'undo delete' ,
4749 onClick : self . undo
4850 end
4951 end
5052
51- # initialize latest mailbox (year+month)
53+ # initialize next mailbox (year+month)
5254 def componentWillMount ( )
53- @latest = @@mbox
55+ @nextmbox = @@mbox
5456 end
5557
5658 # on initial load, fetch latest mailbox and subscribe to keyboard events
@@ -77,9 +79,9 @@ def componentDidUpdate()
7779
7880 # fetch a month's worth of messages
7981 def fetch_month ( )
80- HTTP . post ( '' , mbox : @latest ) do |response |
82+ HTTP . post ( '' , mbox : @nextmbox ) do |response |
8183 # update latest mbox
82- @latest = response . mbox if response . mbox
84+ @nextmbox = response . mbox
8385
8486 # add messages to list
8587 @messages = @messages . concat ( *response . messages )
Original file line number Diff line number Diff line change 2525
2626 # return mailbox name and messages
2727 {
28- mbox : File . basename ( mbox , '.yml' ) ,
28+ mbox : ( File . basename ( mbox , '.yml' ) if index > 0 ) ,
2929 messages : headers . sort_by { |message | message [ :time ] } . reverse
3030 }
3131 end
You can’t perform that action at this time.
0 commit comments