File tree Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change 11
11
export let node: NonNullable <typeof $selected >;
12
12
export let depth = 1 ;
13
13
14
- let _timeout: null | NodeJS .Timeout ;
15
- node .invalidate = () => {
16
- if (_timeout ) return ;
17
-
18
- _timeout = setTimeout (() => {
19
- _timeout = null ;
20
- node = node ;
21
- }, 100 );
22
- };
14
+ node .invalidate = () => (node = node );
23
15
24
16
let lastLength = node .children .length ;
25
17
let flash = false ;
26
18
$ : {
27
19
flash = flash || node .children .length !== lastLength ;
28
20
lastLength = node .children .length ;
29
21
}
30
-
31
- // TODO: report, something really weird with the language server
32
- const iterate = () => node .children ;
33
22
</script >
34
23
35
24
{#if $visibility [node .type ]}
125
114
{/if }
126
115
</li >
127
116
{:else }
128
- {#each iterate () as node ( node .id )}
129
- <svelte:self { node } {depth } />
117
+ {#each node . children as child ( child .id )}
118
+ <svelte:self node ={ child } {depth } />
130
119
{/each }
131
120
{/if }
132
121
Original file line number Diff line number Diff line change 39
39
40
40
<svelte:window
41
41
on:keydown ={({ target , key }) => {
42
- if (target !== document .body ) return ;
43
- if (! $selected ?.invalidate ) return ;
42
+ if (target !== document .body || ! $selected ) return ;
44
43
45
44
if (key === ' Enter' ) {
46
45
$selected .expanded = ! $selected .expanded ;
You can’t perform that action at this time.
0 commit comments