benitlux: refresh home window on receiving an invalid token error
authorAlexis Laferrière <alexis.laf@xymus.net>
Sun, 25 Sep 2016 23:12:33 +0000 (19:12 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Mon, 2 Jan 2017 19:43:36 +0000 (14:43 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/benitlux/src/client/views/home_views.nit

index 44144a8..bd3f851 100644 (file)
@@ -194,6 +194,18 @@ class CheckTokenAction
        redef fun on_load(res, status) do intercept_error(res)
 end
 
+redef class BenitluxHttpRequest
+       redef fun intercept_error(res)
+       do
+               var r = super
+               if res isa BenitluxTokenError then
+                       var window = app.window
+                       if window isa HomeWindow then window.refresh
+               end
+               return r
+       end
+end
+
 # Today's date as a `String`
 fun today: String
 do