Skip to content

Commit 7aa26e9

Browse files
committed
chore: clean up code
1 parent 0642744 commit 7aa26e9

File tree

4 files changed

+5
-37
lines changed

4 files changed

+5
-37
lines changed

frontend/README.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

frontend/src/hooks/useBool.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { ref, type Ref } from 'vue'
1+
import { ref } from 'vue'
22

3-
export const useBool = (initialValue: boolean): [Ref<boolean>, () => void] => {
3+
export const useBool = (initialValue: boolean) => {
44
const value = ref(initialValue)
55

66
const toggle = () => {
77
value.value = !value.value
88
}
99

10-
return [value, toggle]
10+
return [value, toggle] as const
1111
}

frontend/src/views/HomeView/components/GroupsController.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ const groups = computed(() => {
7777
return a.delay - b.delay
7878
})
7979
80-
const chains = []
81-
chains.push(group.now)
80+
const chains = [group.now]
8281
let tmp = proxies[group.now]
8382
while (tmp) {
8483
tmp.now && chains.push(tmp.now)

frontend/src/views/ProfilesView/components/MixinAndScriptConfig.vue

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ const MixinFormatOptions = [
3636
{ label: 'YAML', value: 'yaml' },
3737
]
3838
39-
const MixinEditorKey = ref(0)
40-
4139
const onFormatChange = (val: 'json' | 'yaml', old: 'json' | 'yaml') => {
4240
try {
4341
const config = parse(model.value.mixin.config)
@@ -48,7 +46,6 @@ const onFormatChange = (val: 'json' | 'yaml', old: 'json' | 'yaml') => {
4846
model.value.mixin.config = stringify(config)
4947
}
5048
}
51-
MixinEditorKey.value += 1
5249
} catch (e: any) {
5350
model.value.mixin.format = old
5451
message.error(e.message || e)
@@ -71,12 +68,7 @@ const onFormatChange = (val: 'json' | 'yaml', old: 'json' | 'yaml') => {
7168
@change="onFormatChange"
7269
/>
7370
</div>
74-
<CodeViewer
75-
:key="MixinEditorKey"
76-
v-model="model.mixin.config"
77-
:lang="model.mixin.format"
78-
editable
79-
/>
71+
<CodeViewer v-model="model.mixin.config" :lang="model.mixin.format" editable />
8072
</template>
8173
<template #script>
8274
<CodeViewer v-model="model.script.code" lang="javascript" editable />

0 commit comments

Comments
 (0)