current database in app title

This commit is contained in:
Jan Prochazka
2022-01-30 10:00:02 +01:00
parent 8a60e54d3b
commit bb3c17d6d5
3 changed files with 22 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
<script lang="ts">
import { currentDatabase } from '../stores';
import getElectron from './getElectron';
$: title = $currentDatabase?.name ? `${$currentDatabase?.name} - DbGate` : 'DbGate';
$: {
const electron = getElectron();
if (electron) {
electron.send('set-title', title);
}
}
</script>
<svelte:head>
<title>{title}</title>
</svelte:head>