diff --git a/src/utils/useAtomsDevtools.ts b/src/utils/useAtomsDevtools.ts index 1660c658..b353b853 100644 --- a/src/utils/useAtomsDevtools.ts +++ b/src/utils/useAtomsDevtools.ts @@ -8,8 +8,13 @@ import { getReduxExtension } from './redux-extension/getReduxExtension'; import { SnapshotOptions, useAtomsSnapshot } from './useAtomsSnapshot'; import { useGotoAtomsSnapshot } from './useGotoAtomsSnapshot'; -const atomToPrintable = (atom: AnyAtom) => - atom.debugLabel ? `${atom}:${atom.debugLabel}` : `${atom}`; +const atomToPrintable = (atom: AnyAtom) => { + let str = `${atom}`; + if (atom.debugLabel && !str.endsWith(":" + atom.debugLabel)) { + str += ":" + atom.debugLabel; + } + return str; +}; const getDevtoolsState = (atomsSnapshot: AtomsSnapshot) => { const values: Record = {};