File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/routes/(console)/project-[region]-[project]/settings Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 11
11
import { project , projectRegion } from ' ../store' ;
12
12
import { organization } from ' $lib/stores/organization' ;
13
13
import { Dependencies } from ' $lib/constants' ;
14
+ import { onDestroy , onMount } from ' svelte' ;
14
15
15
16
let error: string ;
16
17
let showDelete = false ;
39
40
trackError (e , Submit .ProjectDelete );
40
41
}
41
42
};
43
+
44
+ const handleKeydown = (e : KeyboardEvent ) => {
45
+ if (e .key === ' Enter' ) {
46
+ if (name !== $project .name ) e .preventDefault ();
47
+ else handleDelete ();
48
+ }
49
+ };
50
+
51
+ onMount (() => {
52
+ window .addEventListener (' keydown' , handleKeydown );
53
+ });
54
+
55
+ onDestroy (() => {
56
+ window .removeEventListener (' keydown' , handleKeydown );
57
+ });
42
58
</script >
43
59
44
60
<CardGrid >
You can’t perform that action at this time.
0 commit comments