project management feature (#15)

Reviewed-on: #15
This commit was merged in pull request #15.
This commit is contained in:
2024-11-01 20:10:28 +00:00
parent 364dabee69
commit a231263825
23 changed files with 511 additions and 245 deletions

View File

@@ -1,5 +1,9 @@
import App from './App.svelte';
import { WindowSetTitle } from "../wailsjs/runtime/runtime"
import {currentProject, needProjectSave} from './stores.js';
// Load dictionaries
import { addMessages, init } from 'svelte-i18n';
@@ -13,11 +17,35 @@ addMessages('en', en);
init({
fallbackLocale: 'en',
initialLocale: 'en',
});
});
// Create the main app
const app = new App({
target: document.body,
});
// Set the initial title
WindowSetTitle("DMXConnect")
// When the current project data is modified, pass it to unsaved and change the title
let title;
currentProject.subscribe(value => {
needProjectSave.set(true)
title = value.Name
});
// If the project need to be saved, show the information in the title
needProjectSave.subscribe(value => {
if (value) {
console.log(`<!> The current project need to be save`);
WindowSetTitle("DMXConnect - " + title + " (unsaved)")
} else {
WindowSetTitle("DMXConnect - " + title)
}
})
document.addEventListener("DOMContentLoaded", function() {
});
export default app;