File tree Expand file tree Collapse file tree 7 files changed +12
-13
lines changed
Expand file tree Collapse file tree 7 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export function useSearch(
3838 } | null > ( null )
3939
4040 const isLoadingMore = shallowRef ( false )
41- const isRateLimited = ref ( false )
41+ const isRateLimited = shallowRef ( false )
4242
4343 const suggestions = shallowRef < SearchSuggestion [ ] > ( [ ] )
4444 const suggestionsLoading = shallowRef ( false )
Original file line number Diff line number Diff line change @@ -10,11 +10,10 @@ import type { Ref } from 'vue'
1010 * @public
1111 */
1212export function useActiveTocItem ( toc : Ref < TocItem [ ] > ) {
13- const activeId = ref < string | null > ( null )
13+ const activeId = shallowRef < string | null > ( null )
1414
1515 // Only run observer logic on client
1616 if ( import . meta. server ) {
17- // eslint-disable-next-line @typescript-eslint/no-empty-function
1817 return { activeId }
1918 }
2019
Original file line number Diff line number Diff line change 11export function useCanGoBack ( ) {
2- const canGoBack = ref ( false )
2+ const canGoBack = shallowRef ( false )
33
44 const router = useRouter ( )
55
Original file line number Diff line number Diff line change @@ -312,11 +312,11 @@ export function useCharts() {
312312 )
313313
314314 const endDateOnly = toDateOnly ( downloadEvolutionOptions . endDate )
315- const end = endDateOnly ? new Date ( ` ${ endDateOnly } T00:00:00.000Z` ) : yesterday
315+ const end = endDateOnly ? parseIsoDateOnly ( endDateOnly ) : yesterday
316316
317317 const startDateOnly = toDateOnly ( downloadEvolutionOptions . startDate )
318318 if ( startDateOnly ) {
319- const start = new Date ( ` ${ startDateOnly } T00:00:00.000Z` )
319+ const start = parseIsoDateOnly ( startDateOnly )
320320 return { start, end }
321321 }
322322
Original file line number Diff line number Diff line change 11export function useFileTreeState ( baseUrl : string ) {
2- const stateKey = computed ( ( ) => `npmx-file-tree${ baseUrl } ` )
3-
4- const expanded = useState < Set < string > > ( stateKey . value , ( ) => new Set < string > ( ) )
2+ const expanded = useState < Set < string > > ( `npmx-file-tree${ baseUrl } ` , ( ) => new Set < string > ( ) )
53
64 function toggleDir ( path : string ) {
75 if ( expanded . value . has ( path ) ) {
Original file line number Diff line number Diff line change 1+ import { defu } from 'defu'
2+
13/**
24 * Abstraction for preferences storage
35 * Currently uses localStorage, designed for future user prefs API
@@ -58,17 +60,17 @@ function createLocalStorageProvider<T>(key: string): StorageProvider<T> {
5860 * Abstracts the storage mechanism to allow future migration to API-based storage
5961 *
6062 */
61- export function usePreferencesProvider < T > ( defaultValue : T ) {
63+ export function usePreferencesProvider < T extends object > ( defaultValue : T ) {
6264 const provider = createLocalStorageProvider < T > ( STORAGE_KEY )
63- const data = ref < T > ( defaultValue ) as Ref < T >
65+ const data = ref < T > ( defaultValue )
6466 const isHydrated = shallowRef ( false )
6567
6668 // Load from storage on client
6769 onMounted ( ( ) => {
6870 const stored = provider . get ( )
6971 if ( stored ) {
7072 // Merge stored values with defaults to handle schema evolution
71- data . value = { ... defaultValue , ... stored }
73+ data . value = defu ( stored , defaultValue )
7274 }
7375 isHydrated . value = true
7476 } )
Original file line number Diff line number Diff line change @@ -453,7 +453,7 @@ const isLoadingLikeData = computed(
453453 () => likeStatus .value !== ' error' && likeStatus .value !== ' success' ,
454454)
455455
456- const isLikeActionPending = ref (false )
456+ const isLikeActionPending = shallowRef (false )
457457
458458const likeAction = async () => {
459459 if (user .value ?.handle == null ) {
You can’t perform that action at this time.
0 commit comments