Skip to content

Commit

Permalink
fix: Jump In doesn't work for Worlds (#715)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinszuchet authored Dec 12, 2024
1 parent 4dd96d9 commit ac4cf4f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/components/Button/AttendingButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import shareIcon from "../../images/share.svg"
import { launchDesktopApp } from "../../modules/desktop"
import locations from "../../modules/locations"
import { SegmentEvent } from "../../modules/segment"
import { getReamls } from "../../modules/servers"
import { getRealms } from "../../modules/servers"
import { Star } from "../Icon/Star"
import DownloadModal from "../Modal/DownloadModal"

Expand Down Expand Up @@ -137,7 +137,7 @@ export default function AttendingButtons(props: AttendingButtonsProps) {
[setFallbackShare]
)

const [servers] = useAsyncMemo(getReamls)
const [servers] = useAsyncMemo(getRealms)

let hasDecentralandLauncher: null | boolean = null

Expand Down
4 changes: 2 additions & 2 deletions src/components/Button/JumpInPosition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import secondaryPinIcon from "../../images/secondary-pin-small.svg"
import { launchDesktopApp } from "../../modules/desktop"
import locations from "../../modules/locations"
import { SegmentEvent } from "../../modules/segment"
import { getReamls } from "../../modules/servers"
import { getRealms } from "../../modules/servers"
import DownloadModal from "../Modal/DownloadModal"

import "./JumpInPosition.css"
Expand All @@ -30,7 +30,7 @@ export default function JumpInPosition({
}: JumpInPositionProps) {
const track = useTrackContext()
const [showModal, setShowModal] = useState(false)
const [servers] = useAsyncMemo(getReamls)
const [servers] = useAsyncMemo(getRealms)

const isPosition = !!event
const position = isPosition ? event && `${event.x},${event.y}` : "HTTP"
Expand Down
9 changes: 7 additions & 2 deletions src/entities/Event/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function eventTargetUrl(
}

export function eventClientOptions(
event: Pick<EventAttributes, "x" | "y" | "server">,
event: Pick<EventAttributes, "x" | "y" | "server" | "world">,
servers?: (CatalystAbout | null)[] | null
): {
position: string
Expand All @@ -90,7 +90,12 @@ export function eventClientOptions(
}

let realmURL
if (event.server && servers) {

if (event.world) {
realmURL = event.server
}

if (!realmURL && event.server && servers) {
realmURL = servers
.map((server) => {
if (server?.configurations?.realmName === event.server) {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/servers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const getServers = memo(
{ ttl: Infinity }
)

export const getReamls = memo(
export const getRealms = memo(
async () => {
const servers: { address: string }[] = cache.catalysts.mainnet
// add main realm
Expand Down
4 changes: 2 additions & 2 deletions src/pages/submit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import WorldIcon from "../../images/worlds-icon.svg"
import { getSchedules, getSchedulesOptions } from "../../modules/events"
import { Flags } from "../../modules/features"
import locations from "../../modules/locations"
import { getReamls, getServerOptions } from "../../modules/servers"
import { getRealms, getServerOptions } from "../../modules/servers"
import { getWorldNames, getWorldNamesOptions } from "../../modules/worlds"

import "./index.css"
Expand Down Expand Up @@ -185,7 +185,7 @@ export default function SubmitPage() {

const [state, patchState] = usePatchState<SubmitPageState>({})
const [account, accountState] = useAuthContext()
const [servers] = useAsyncMemo(getReamls)
const [servers] = useAsyncMemo(getRealms)
const [worlds] = useAsyncMemo(getWorldNames)
const [categories] = useCategoriesContext()
const [schedules] = useAsyncMemo(getSchedules)
Expand Down

0 comments on commit ac4cf4f

Please sign in to comment.