Просмотр исходного кода

Merge pull request #20317 from overleaf/em-github-sync-errors

Replace alerts with notifications in the github-sync modal

GitOrigin-RevId: 772add41b2d525353dc0c0362ebc64c4a023e2c3
Eric Mc Sween 1 год назад
Родитель
Сommit
889fa1a3c3
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      services/web/frontend/stories/hooks/use-scope.tsx

+ 5 - 1
services/web/frontend/stories/hooks/use-scope.tsx

@@ -19,7 +19,11 @@ export const useScope = (scope: Record<string, unknown>) => {
         } catch {
           // allowed not to exist
         }
-        window.overleaf.unstable.store.set(path, merge(existingValue, value))
+        if (typeof existingValue === 'object' && typeof value === 'object') {
+          window.overleaf.unstable.store.set(path, merge(existingValue, value))
+        } else {
+          window.overleaf.unstable.store.set(path, value)
+        }
       }
     }
   }, [])