rails_live_reload 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a12bfdd549b010582467b39ea3f897cd1576b6e85f9595893482cc6d9738a8bf
4
- data.tar.gz: 0e1340b8b309f291c4e0eeae134ba70409c26bd483316c512670c815e056f738
3
+ metadata.gz: 196b1a989e9edbbb5a2e50612eb9aab60f6cb84b8715e1cc5c9d762bc3a3fb88
4
+ data.tar.gz: 90ea51cc27fd92551f44093fcf37e86f7cd7f1a7f456ac28ed26b853fabe6244
5
5
  SHA512:
6
- metadata.gz: 64ccc99a6ae7c6e858bc6b623aa38b2f52000b2aa4131e01e2f54438dd186913a625a8e6bc9a45ae80e72012d25ce4be3a701f5bd1df59eb8585ccccbd0ac8d1
7
- data.tar.gz: dff2d37006b4316bcd4d5dcfd2fd97f5f116c300fe1fb2313082abe226b6f5443f883477338bc08ca19da795a4ef61c96849b20e4be3981903ebecf704956818
6
+ metadata.gz: 2b76a54f034ae6077091db8feb2d8aa1995845c442880fa198c03b9ee2381eccd4a692bf9d3fd3bc073b9c569fb8f93fc64a8315050da80d60346cb09abbab9e
7
+ data.tar.gz: 47260a57c05b2d3b895609f6dc162a4f37fc042eeba997109abdc44c5b085efc895cc7d8530c9aced2082e5eecac001ca0e01c31b29f7bb27d086ab11df6e69b
@@ -5,7 +5,7 @@ module RailsLiveReload
5
5
  %Q{
6
6
  <script>
7
7
  const files = #{CurrentRequest.current.data.to_a.to_json};
8
- setInterval(
8
+ const timer = setInterval(
9
9
  () => {
10
10
  const formData = new FormData();
11
11
  formData.append('dt', #{Time.now.to_i})
@@ -22,7 +22,8 @@ module RailsLiveReload
22
22
  .then(response => response.json())
23
23
  .then(data => {
24
24
  if(data['command'] === 'RELOAD') {
25
- window.location.reload()
25
+ clearInterval(timer);
26
+ window.location.reload();
26
27
  }
27
28
  })
28
29
  }, #{RailsLiveReload.timeout}
@@ -1,3 +1,3 @@
1
1
  module RailsLiveReload
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_live_reload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Kasyanchuk
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  - !ruby/object:Gem::Version
151
151
  version: '0'
152
152
  requirements: []
153
- rubygems_version: 3.3.3
153
+ rubygems_version: 3.2.3
154
154
  signing_key:
155
155
  specification_version: 4
156
156
  summary: Ruby on Rails Live Reload