Skip to content

Commit

Permalink
viewer: query project data based on path, instead of hard coded
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-kev committed Apr 8, 2024
1 parent 28809d7 commit 3960f15
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@
import 'viewer/component';
import {type LexboxServiceProvider} from 'viewer/service-provider';
import {LfClassicLexboxApi} from './lfClassicLexboxApi';
import type {PageData} from './$types';
export let data: PageData;
setLexboxApiProvider();
// onMount(() => {
// });
function setLexboxApiProvider() {
const serviceProvider: LexboxServiceProvider = window.lexbox.ServiceProvider;
serviceProvider.setService('LexboxApi', new LfClassicLexboxApi('sena-3'));
const serviceProvider: LexboxServiceProvider = window.lexbox.ServiceProvider;
let service: LfClassicLexboxApi;
$: {
if (serviceProvider) {
let localService = new LfClassicLexboxApi(data.code);
serviceProvider.setService('LexboxApi', localService);
service = localService;
}
}
</script>
<lexbox-svelte></lexbox-svelte>
{#if service}
{#key service}
<lexbox-svelte></lexbox-svelte>
{/key}
{/if}
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
export const ssr = false; // 💖
import type {PageLoadEvent} from './$types';
export const ssr = false; // 💖
export function load(event: PageLoadEvent) {
return {code: event.params.project_code};
}

0 comments on commit 3960f15

Please sign in to comment.