Skip to content

Commit

Permalink
still debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ErinClaudio committed Jun 22, 2023
1 parent a321b92 commit 701b190
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ def set_current_user
RequestStore.store[:current_user] = current_user
end

# def set_timeout_duration
# @timeout_duration = current_user.timeout_in
# end
def set_timeout_duration
@timeout_duration = current_user.timeout_in
end

def set_current_organization
RequestStore.store[:current_organization] = current_organization
Expand Down
3 changes: 2 additions & 1 deletion app/javascript/src/session_timeout_poller.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@

const deviseTimeoutInMinutes = 180
// const timeoutDuration = <%= 3.hours.to_i * 60 %>;
// const timeoutDuration = <%= @timeout_duration || 180 %>;
const timeoutDuration = 180;
// I could do this below if this is preferred
// const deviseTimeoutInMinutes = timeoutDuration || 180;
const twoMinuteWarning = deviseTimeoutInMinutes - 2
const totalTimerAmount = twoMinuteWarning * 60 * 1000
const deviseTimeoutInMilliseconds = deviseTimeoutInMinutes * 60 * 1000
// config.timeout_in = 3.hours
const startTime = new Date().getTime()
let lastTime = new Date().getTime()
let currentTime
Expand Down
8 changes: 6 additions & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@
<%= og_tag :image, content: image_url('login.jpg') %>
<%= render 'shared/favicons' %>
<% binding.pry %>
<script>



<script>
var timeout = <%= @timeout_duration %>
console.log("here", timeout)
</script>

<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
Expand Down

0 comments on commit 701b190

Please sign in to comment.