Skip to content

Commit

Permalink
fix(devtools): setup the settings panel immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
noootwo committed Dec 13, 2024
1 parent 4715104 commit 89ac583
Showing 1 changed file with 23 additions and 24 deletions.
47 changes: 23 additions & 24 deletions packages/pinia/src/devtools/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,27 @@ const MUTATIONS_LAYER_ID = 'pinia:mutations'
const INSPECTOR_ID = 'pinia'
const { assign } = Object

const pluginDescriptor = {
id: 'dev.esm.pinia',
label: 'Pinia 🍍',
logo: 'https://pinia.vuejs.org/logo.svg',
packageName: 'pinia',
homepage: 'https://pinia.vuejs.org',
componentStateTypes,
settings: {
logStoreChanges: {
label: 'Notify about new/deleted stores',
type: 'boolean',
defaultValue: true,
},
// useEmojis: {
// label: 'Use emojis in messages ⚡️',
// type: 'boolean',
// defaultValue: true,
// },
},
} as const

/**
* Gets the displayed name of a store in devtools
*
Expand All @@ -55,12 +76,7 @@ const getStoreType = (id: string) => '🍍 ' + id
export function registerPiniaDevtools(app: DevtoolsApp, pinia: Pinia) {
setupDevtoolsPlugin(
{
id: 'dev.esm.pinia',
label: 'Pinia 🍍',
logo: 'https://pinia.vuejs.org/logo.svg',
packageName: 'pinia',
homepage: 'https://pinia.vuejs.org',
componentStateTypes,
...pluginDescriptor,
app,
},
(api) => {
Expand Down Expand Up @@ -308,25 +324,8 @@ function addStoreToDevtools(app: DevtoolsApp, store: StoreGeneric) {

setupDevtoolsPlugin(
{
id: 'dev.esm.pinia',
label: 'Pinia 🍍',
logo: 'https://pinia.vuejs.org/logo.svg',
packageName: 'pinia',
homepage: 'https://pinia.vuejs.org',
componentStateTypes,
...pluginDescriptor,
app,
settings: {
logStoreChanges: {
label: 'Notify about new/deleted stores',
type: 'boolean',
defaultValue: true,
},
// useEmojis: {
// label: 'Use emojis in messages ⚡️',
// type: 'boolean',
// defaultValue: true,
// },
},
},
(api) => {
// gracefully handle errors
Expand Down

0 comments on commit 89ac583

Please sign in to comment.