1
1
<script lang="ts" setup>
2
2
import { ref } from ' vue'
3
3
import { useLocalStorage } from ' @vueuse/core'
4
+ import { clearStorage } from ' @vue-devtools/shared-utils'
4
5
import { supportsScreenshot } from ' ../timeline/composable/screenshot'
5
6
6
7
type Tab = ' global' | ' components' | ' timeline'
@@ -10,6 +11,8 @@ const tab = ref<Tab>('global')
10
11
const hideAppSelector = useLocalStorage (' split-pane-collapsed-left-app-select-pane' , false )
11
12
const hideTimelineCanvas = useLocalStorage (' split-pane-collapsed-left-timeline-right' , false )
12
13
const hideEvents = useLocalStorage (' split-pane-collapsed-right-timeline-right' , false )
14
+
15
+ const confirmClearStorage = ref (false )
13
16
</script >
14
17
15
18
<template >
@@ -98,6 +101,12 @@ const hideEvents = useLocalStorage('split-pane-collapsed-right-timeline-right',
98
101
<VueSwitch v-model =" $shared.debugInfo" >
99
102
Enable
100
103
</VueSwitch >
104
+
105
+ <VueButton
106
+ @click =" confirmClearStorage = true"
107
+ >
108
+ Clear storage
109
+ </VueButton >
101
110
</VueFormField >
102
111
</div >
103
112
@@ -197,6 +206,31 @@ const hideEvents = useLocalStorage('split-pane-collapsed-right-timeline-right',
197
206
</VueSwitch >
198
207
</VueFormField >
199
208
</div >
209
+
210
+ <VueModal
211
+ v-if =" confirmClearStorage"
212
+ title =" Clear storage"
213
+ @close =" confirmClearStorage = false"
214
+ >
215
+ <div class =" p-6 space-y-6" >
216
+ <p >
217
+ Are you sure you want to clear all storage?
218
+ </p >
219
+ <div class =" flex justify-end gap-2" >
220
+ <VueButton
221
+ @click =" confirmClearStorage = false"
222
+ >
223
+ Cancel
224
+ </VueButton >
225
+ <VueButton
226
+ class =" danger"
227
+ @click =" clearStorage();confirmClearStorage = false"
228
+ >
229
+ Clear
230
+ </VueButton >
231
+ </div >
232
+ </div >
233
+ </VueModal >
200
234
</div >
201
235
</template >
202
236
0 commit comments