mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 20:06:00 +00:00
current database in app title
This commit is contained in:
17
packages/web/src/utility/AppTitleProvider.svelte
Normal file
17
packages/web/src/utility/AppTitleProvider.svelte
Normal 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>
|
||||
Reference in New Issue
Block a user