Files
OSIT-AE-App-Svelte/src/main.ts

31 lines
1.3 KiB
TypeScript

import { ae } from 'aether_npm_lib';
import './app.css';
// import App from './App.svelte';
import Sponsorships from './0_sponsorships__main.svelte';
let url_params = ae.util.get_url_params();
// console.log(url_params);
// IMPORTANT: The URL paramater 'uuid' is used to determine if the user is logged in or not. If the user is logged in, the uuid will be passed in as a url param. If the user is not logged in, the uuid will not be passed in as a url param.
if (document.getElementById('app')) {
const app = new App({
target: document.getElementById('app'),
});
}
if (document.querySelector('.svelte_target.ae_sponsorships_main')) {
const sponsorships_main_app = new Sponsorships({
target: document.querySelector('.svelte_target.ae_sponsorships_main'),
props: {
// NOTE: decodeURIComponent() is needed because the value is passed in as a url param. Should this be taken care of by the ae.util.get_url_params() function?
'sponsorship_id': url_params.sponsorship_id,
'user': decodeURIComponent(url_params.email),
'key': (url_params.key ? url_params.key : false),
// 'results_limit_administrator': 75,
// 'results_limit_trusted': 50,
// 'results_limit_authenticated': 25,
}
});
}