2022-08-14 20:27:41 +00:00
|
|
|
<script>
|
|
|
|
import { emit, listen } from '@tauri-apps/api/event';
|
2023-04-24 19:05:11 +00:00
|
|
|
import { invoke } from '@tauri-apps/api/tauri';
|
2022-11-28 06:03:15 +00:00
|
|
|
|
2023-04-25 15:49:00 +00:00
|
|
|
import { appState } from './lib/state.js';
|
2023-04-26 05:10:14 +00:00
|
|
|
import { navigate, currentView } from './lib/routing.js';
|
2022-11-28 06:03:15 +00:00
|
|
|
|
|
|
|
|
2023-04-26 05:10:14 +00:00
|
|
|
invoke('get_config').then(config => $appState.config = config);
|
|
|
|
|
2022-11-28 06:03:15 +00:00
|
|
|
listen('credentials-request', (tauriEvent) => {
|
2023-04-25 15:49:00 +00:00
|
|
|
$appState.pendingRequests.put(tauriEvent.payload);
|
2022-11-28 06:03:15 +00:00
|
|
|
});
|
2023-04-26 05:10:14 +00:00
|
|
|
|
|
|
|
// can't set this in routing.js directly for some reason
|
|
|
|
if (!$currentView) {
|
|
|
|
navigate('Home');
|
|
|
|
}
|
2022-08-14 20:27:41 +00:00
|
|
|
</script>
|
|
|
|
|
2023-04-24 19:05:11 +00:00
|
|
|
|
2023-04-26 05:10:14 +00:00
|
|
|
<svelte:component this="{$currentView}" />
|