diff --git a/components/Header/index.tsx b/components/Header/index.tsx index a2d86abb..011362a4 100644 --- a/components/Header/index.tsx +++ b/components/Header/index.tsx @@ -12,6 +12,7 @@ import { accountState, initialAccountState } from '~utils/accountState' import { appState, initialAppState } from '~utils/appState' import { getLocalId } from '~utils/localId' import { retrieveLocaleCookies } from '~utils/retrieveCookies' +import { setEditKey, storeEditKey } from '~utils/userToken' import { DropdownMenu, @@ -196,6 +197,13 @@ const Header = () => { .remix({ shortcode: partySnapshot.shortcode, body: body }) .then((response) => { const remix = response.data.party + + // Store the edit key in local storage + if (remix.edit_key) { + storeEditKey(remix.id, remix.edit_key) + setEditKey(remix.id, remix.user) + } + router.push(`/p/${remix.shortcode}`) setRemixToastOpen(true) }) diff --git a/components/Hovercard/index.scss b/components/Hovercard/index.scss index c0c803bb..ed4e6fa5 100644 --- a/components/Hovercard/index.scss +++ b/components/Hovercard/index.scss @@ -1,3 +1,7 @@ +div[data-radix-popper-content-wrapper] { + z-index: 10 !important; +} + .HovercardContent { animation: scaleIn $duration-zoom ease-out; transform-origin: var(--radix-hover-card-content-transform-origin); diff --git a/components/Party/index.tsx b/components/Party/index.tsx index 3bc61ce1..900898fb 100644 --- a/components/Party/index.tsx +++ b/components/Party/index.tsx @@ -3,7 +3,6 @@ import { getCookie } from 'cookies-next' import { useRouter } from 'next/router' import { subscribe, useSnapshot } from 'valtio' import clonedeep from 'lodash.clonedeep' -import ls from 'local-storage' import PartySegmentedControl from '~components/PartySegmentedControl' import PartyDetails from '~components/PartyDetails' @@ -17,7 +16,7 @@ import { appState, initialAppState } from '~utils/appState' import { getLocalId } from '~utils/localId' import { GridType } from '~utils/enums' import { retrieveCookies } from '~utils/retrieveCookies' -import { setEditKey, unsetEditKey } from '~utils/userToken' +import { setEditKey, storeEditKey, unsetEditKey } from '~utils/userToken' import type { DetailsObject } from '~types' @@ -240,10 +239,6 @@ const Party = (props: Props) => { return team } - const storeEditKey = (id: string, key: string) => { - ls(id, key) - } - const storeCharacters = (list: Array) => { list.forEach((object: GridCharacter) => { if (object.position != null) diff --git a/utils/userToken.tsx b/utils/userToken.tsx index 08563bda..aebd920e 100644 --- a/utils/userToken.tsx +++ b/utils/userToken.tsx @@ -26,6 +26,10 @@ export const setHeaders = ( } } +export const storeEditKey = (id: string, key: string) => { + ls(id, key) +} + export const setEditKey = (id: string, user?: User) => { if (!user) { const edit_key = get(id)