Skip to content

Commit

Permalink
refactor: Applied suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
  • Loading branch information
jd-solanki and antfu committed Sep 3, 2022
1 parent 56b6f35 commit 17a5d9e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/inspector/client/components/ReplPlayground.vue
Expand Up @@ -10,7 +10,7 @@ const input = useLocalStorage(
'<div class="text-sm hover:text-red">\nHello World\n</div>',
)
const isSafelistIncluded = ref(false)
const isSafelistIncluded = useStorage('unocss-inspector-safelist', false)
const { data: result } = fetchRepl(input, isSafelistIncluded)
</script>

Expand Down
2 changes: 1 addition & 1 deletion packages/inspector/client/composables/fetch.ts
Expand Up @@ -34,7 +34,7 @@ export function fetchModule(id: string | Ref<string>) {

export function fetchRepl(input: Ref<string>, includeSafelist: Ref<boolean>) {
const debounced = useDebounce(input, 500)
return useFetch(computed(() => `${API_ROOT}/repl?token=${encodeURIComponent(debounced.value)}&include-safelist=${includeSafelist.value}`), { refetch: true })
return useFetch(computed(() => `${API_ROOT}/repl?token=${encodeURIComponent(debounced.value)}&safelist=${includeSafelist.value}`), { refetch: true })
.json<Result>()
}

Expand Down
2 changes: 1 addition & 1 deletion packages/inspector/node/index.ts
Expand Up @@ -65,7 +65,7 @@ export default function UnocssInspector(ctx: UnocssPluginContext): Plugin {
if (req.url.startsWith('/repl')) {
const query = new URLSearchParams(req.url.slice(5))
const token = query.get('token') || ''
const includeSafelist = JSON.parse(query.get('include-safelist') ?? 'false')
const includeSafelist = JSON.parse(query.get('safelist') ?? 'false')

const result = await ctx.uno.generate(token, { preflights: false, safelist: includeSafelist })
const mod = {
Expand Down

0 comments on commit 17a5d9e

Please sign in to comment.