forked from coracle/flotilla
ba1757d4f1
#60 Co-authored-by: mplorentz <mplorentz@users.noreply.github.com> Reviewed-on: coracle/flotilla#81 Co-authored-by: Matt Lorentz <mplorentz@noreply.coracle.social> Co-committed-by: Matt Lorentz <mplorentz@noreply.coracle.social>
15 lines
396 B
TypeScript
15 lines
396 B
TypeScript
import {page} from "$app/stores"
|
|
|
|
export const lastPageBySpaceUrl = new Map<string, string>()
|
|
export let lastChatUrl: string | undefined = undefined
|
|
|
|
export const setupHistory = () =>
|
|
page.subscribe($page => {
|
|
if ($page.params.relay) {
|
|
lastPageBySpaceUrl.set($page.params.relay, $page.url.pathname)
|
|
}
|
|
if ($page.params.chat) {
|
|
lastChatUrl = $page.url.pathname
|
|
}
|
|
})
|