svelte-log-view 6.3.3 → 6.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/LogView.svelte +11 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-log-view",
3
- "version": "6.3.3",
3
+ "version": "6.3.5",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -28,19 +28,15 @@
28
28
 
29
29
  onDestroy(() => source.abort());
30
30
 
31
- let done = false;
32
-
33
- $effect(() => {
34
- if(!done) {
35
- fetchFollow();
36
- done = true;
37
- }
38
- });
31
+ fetchFollow();
39
32
 
40
33
  async function fetchFollow() {
41
34
  let current;
42
35
  if (entries.length > 0) {
43
36
  current = entries[entries.length - 1];
37
+ if (follow) {
38
+ setSelected(entries.length - 1);
39
+ }
44
40
  }
45
41
 
46
42
  do {
@@ -97,17 +93,14 @@
97
93
  }
98
94
 
99
95
  function setFollow(flag) {
100
- if (follow === flag) {
101
- return;
102
- }
103
-
104
- if (flag) {
105
- fetchFollow();
106
- } else {
107
- source.abort();
96
+ if (follow !== flag) {
97
+ follow = flag;
98
+ if (flag) {
99
+ fetchFollow();
100
+ } else {
101
+ source.abort();
102
+ }
108
103
  }
109
-
110
- follow = flag;
111
104
  }
112
105
 
113
106
  function onkeydown(event) {