Yuki Takei 2 лет назад
Родитель
Сommit
84c3cd0140
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      apps/app/src/stores/ui.tsx

+ 2 - 2
apps/app/src/stores/ui.tsx

@@ -181,7 +181,7 @@ export const useIsDeviceSmallerThanMd = (): SWRResponse<boolean, Error> => {
   const { cache, mutate } = useSWRConfig();
   const { cache, mutate } = useSWRConfig();
 
 
   useEffect(() => {
   useEffect(() => {
-    if (isClient()) {
+    if (key != null) {
       const mdOrAvobeHandler = function(this: MediaQueryList): void {
       const mdOrAvobeHandler = function(this: MediaQueryList): void {
         // sm -> md: matches will be true
         // sm -> md: matches will be true
         // md -> sm: matches will be false
         // md -> sm: matches will be false
@@ -209,7 +209,7 @@ export const useIsDeviceSmallerThanLg = (): SWRResponse<boolean, Error> => {
   const { cache, mutate } = useSWRConfig();
   const { cache, mutate } = useSWRConfig();
 
 
   useEffect(() => {
   useEffect(() => {
-    if (isClient()) {
+    if (key != null) {
       const lgOrAvobeHandler = function(this: MediaQueryList): void {
       const lgOrAvobeHandler = function(this: MediaQueryList): void {
         // md -> lg: matches will be true
         // md -> lg: matches will be true
         // lg -> md: matches will be false
         // lg -> md: matches will be false