Skip to content

Commit

Permalink
feat: update correct $page.route.id use;
Browse files Browse the repository at this point in the history
  • Loading branch information
migbash committed Feb 13, 2023
1 parent a8c7b32 commit 46dfa20
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 195 deletions.
10 changes: 4 additions & 6 deletions src/hooks.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import cookie from 'cookie';
import { dlog } from '$lib/utils/debug';
import { platfrom_lang_ssr } from '$lib/utils/platform-functions';
import type {
Handle,
RequestEvent
Handle,
RequestEvent
} from '@sveltejs/kit';

/**
Expand Down Expand Up @@ -113,12 +113,10 @@ export function getSession(event) {
* @returns {string} language
*/
function get_lang(
event: RequestEvent<
Partial<Record<string, string>>
>
event: RequestEvent<Partial<Record<string, string>>>
): string {
const lang = platfrom_lang_ssr(
event?.routeId,
event?.route.id,
event?.error, // FIXME: event.error does not exist in a hook
event?.params?.lang
);
Expand Down
Loading

0 comments on commit 46dfa20

Please sign in to comment.