generated from thinkode/modelRepository
project management feature (#15)
Reviewed-on: #15
This commit was merged in pull request #15.
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user