File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed
apps/desktop/src/routes/[projectId] Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change 173
173
174
174
const backend = inject (BACKEND );
175
175
$effect (() => {
176
+ let baseTitle: string ;
176
177
let windowTitle: string ;
177
178
const projectTitle = currentProject ?.title ;
178
179
179
- backend .getWindowTitle ().then ((value ) => {
180
- windowTitle = value ;
181
- if (projectTitle ) backend .setWindowTitle (` ${projectTitle } — ${value } ` );
182
- });
180
+ Promise .all ([backend .getAppInfo (), backend .getWindowTitle ()]).then (
181
+ ([appInfo , currentTitle ]) => {
182
+ baseTitle = appInfo .name ;
183
+
184
+ if (! currentTitle .includes (' — ' )) {
185
+ windowTitle = currentTitle ;
186
+ }
187
+
188
+ if (projectTitle ) {
189
+ backend .setWindowTitle (` ${projectTitle } — ${baseTitle } ` );
190
+ }
191
+ }
192
+ );
183
193
184
194
return () => {
185
- if (windowTitle ) backend .setWindowTitle (windowTitle );
195
+ if (windowTitle ) {
196
+ backend .setWindowTitle (windowTitle );
197
+ } else if (baseTitle ) {
198
+ backend .setWindowTitle (baseTitle );
199
+ }
186
200
};
187
201
});
188
202
You can’t perform that action at this time.
0 commit comments