Skip to content

Commit 89ac583

Browse files
committed
fix(devtools): setup the settings panel immediately
1 parent 4715104 commit 89ac583

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

packages/pinia/src/devtools/plugin.ts

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,27 @@ const MUTATIONS_LAYER_ID = 'pinia:mutations'
3737
const INSPECTOR_ID = 'pinia'
3838
const { assign } = Object
3939

40+
const pluginDescriptor = {
41+
id: 'dev.esm.pinia',
42+
label: 'Pinia 🍍',
43+
logo: 'https://pinia.vuejs.org/logo.svg',
44+
packageName: 'pinia',
45+
homepage: 'https://pinia.vuejs.org',
46+
componentStateTypes,
47+
settings: {
48+
logStoreChanges: {
49+
label: 'Notify about new/deleted stores',
50+
type: 'boolean',
51+
defaultValue: true,
52+
},
53+
// useEmojis: {
54+
// label: 'Use emojis in messages ⚡️',
55+
// type: 'boolean',
56+
// defaultValue: true,
57+
// },
58+
},
59+
} as const
60+
4061
/**
4162
* Gets the displayed name of a store in devtools
4263
*
@@ -55,12 +76,7 @@ const getStoreType = (id: string) => '🍍 ' + id
5576
export function registerPiniaDevtools(app: DevtoolsApp, pinia: Pinia) {
5677
setupDevtoolsPlugin(
5778
{
58-
id: 'dev.esm.pinia',
59-
label: 'Pinia 🍍',
60-
logo: 'https://pinia.vuejs.org/logo.svg',
61-
packageName: 'pinia',
62-
homepage: 'https://pinia.vuejs.org',
63-
componentStateTypes,
79+
...pluginDescriptor,
6480
app,
6581
},
6682
(api) => {
@@ -308,25 +324,8 @@ function addStoreToDevtools(app: DevtoolsApp, store: StoreGeneric) {
308324

309325
setupDevtoolsPlugin(
310326
{
311-
id: 'dev.esm.pinia',
312-
label: 'Pinia 🍍',
313-
logo: 'https://pinia.vuejs.org/logo.svg',
314-
packageName: 'pinia',
315-
homepage: 'https://pinia.vuejs.org',
316-
componentStateTypes,
327+
...pluginDescriptor,
317328
app,
318-
settings: {
319-
logStoreChanges: {
320-
label: 'Notify about new/deleted stores',
321-
type: 'boolean',
322-
defaultValue: true,
323-
},
324-
// useEmojis: {
325-
// label: 'Use emojis in messages ⚡️',
326-
// type: 'boolean',
327-
// defaultValue: true,
328-
// },
329-
},
330329
},
331330
(api) => {
332331
// gracefully handle errors

0 commit comments

Comments
 (0)