Hotfix: blank page for booking embed in Incognito Chrome (#2700)
* Merge remote-tracking branch 'origin/main' into feat/success-url * Fix localstorage access * Fix Comments * make custom eleemnt explicitly 100% in width to go full width in a flex type parent Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
6a18b40c97
commit
9825754b32
6 files changed
+34
-7
No files matched your search
@@ -1,5 +1,7 @@
|
||||
import { createContext, ReactNode, useContext } from "react";
|
||||
|
||||
import { localStorage } from "@calcom/lib/webstorage";
|
||||
|
||||
type contractsContextType = Record<string, string>;
|
||||
|
||||
const contractsContextDefaultValue: contractsContextType = {};
|
||||
@@ -21,18 +23,17 @@ interface addContractsPayload {
|
||||
|
||||
export function ContractsProvider({ children }: Props) {
|
||||
const addContract = (payload: addContractsPayload) => {
|
||||
window.localStorage.setItem(
|
||||
localStorage.setItem(
|
||||
"contracts",
|
||||
JSON.stringify({
|
||||
...JSON.parse(window.localStorage.getItem("contracts") || "{}"),
|
||||
...JSON.parse(localStorage.getItem("contracts") || "{}"),
|
||||
[payload.address]: payload.signature,
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
const value = {
|
||||
contracts:
|
||||
typeof window !== "undefined" ? JSON.parse(window.localStorage.getItem("contracts") || "{}") : {},
|
||||
contracts: typeof window !== "undefined" ? JSON.parse(localStorage.getItem("contracts") || "{}") : {},
|
||||
addContract,
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user