File tree Expand file tree Collapse file tree 2 files changed +5
-14
lines changed
apps/dashboard/components/layout Expand file tree Collapse file tree 2 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -15,22 +15,14 @@ export function ThemeToggle({ className }: ThemeTogglerProps) {
1515 const switchTheme = ( ) => {
1616 setTheme ( resolvedTheme === 'dark' ? 'light' : 'dark' ) ;
1717 } ;
18-
19- const toggleTheme = ( ) => {
20- if ( ! document . startViewTransition ) {
21- switchTheme ( ) ;
22- }
23- document . startViewTransition ( switchTheme ) ;
24- } ;
25-
2618 return (
2719 < Button
2820 aria-label = "Toggle theme"
2921 className = { cn (
3022 'relative hidden h-8 w-8 transition-all duration-200 hover:bg-accent/50 md:flex' ,
3123 className
3224 ) }
33- onClick = { toggleTheme }
25+ onClick = { switchTheme }
3426 type = "button"
3527 variant = "ghost"
3628 >
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import { getRedisCache } from './redis';
22
33const logger = console ;
44
5+ const stringifyRegex = / ^ \d { 4 } - \d { 2 } - \d { 2 } T \d { 2 } : \d { 2 } : \d { 2 } .* Z $ / ;
6+
57interface CacheOptions {
68 expireInSec : number ;
79 prefix ?: string ;
@@ -15,10 +17,7 @@ interface CacheOptions {
1517const defaultSerialize = ( data : unknown ) : string => JSON . stringify ( data ) ;
1618const defaultDeserialize = ( data : string ) : unknown =>
1719 JSON . parse ( data , ( _ , value ) => {
18- if (
19- typeof value === 'string' &&
20- / ^ \d { 4 } - \d { 2 } - \d { 2 } T \d { 2 } : \d { 2 } : \d { 2 } .* Z $ / . test ( value )
21- ) {
20+ if ( typeof value === 'string' && stringifyRegex . test ( value ) ) {
2221 return new Date ( value ) ;
2322 }
2423 return value ;
@@ -201,7 +200,7 @@ export function cacheable<T extends (...args: any) => any>(
201200 } ;
202201
203202 cachedFn . getKey = getKey ;
204- cachedFn . clear = async ( ...args : Parameters < T > ) => {
203+ cachedFn . clear = ( ...args : Parameters < T > ) => {
205204 const key = getKey ( ...args ) ;
206205 const redis = getRedisCache ( ) ;
207206 return redis . del ( key ) ;
You can’t perform that action at this time.
0 commit comments