File size: 562 Bytes
01f62f3
b8b73b2
 
 
 
 
 
 
 
 
 
 
05acf81
b8b73b2
01f62f3
 
b8b73b2
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<script lang="ts">
  import Directory from './Directory.svelte';
  import Workspace from './Workspace.svelte';
  let page = '';
  let parameters = {};
  function onHashChange() {
    const parts = location.hash.split('?');
    page = parts[0].substring(1);
    parameters = {};
    if (parts.length > 1) {
      parameters = Object.fromEntries(new URLSearchParams(parts[1]));
    }
  }
  onHashChange();
</script>

<svelte:window on:hashchange={onHashChange} />
{#if page === 'edit'}
  <Workspace {...parameters} />
{:else}
  <Directory {...parameters} />
{/if}