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 173173
174174 const backend = inject (BACKEND );
175175 $effect (() => {
176+ let baseTitle: string ;
176177 let windowTitle: string ;
177178 const projectTitle = currentProject ?.title ;
178179
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+ );
183193
184194 return () => {
185- if (windowTitle ) backend .setWindowTitle (windowTitle );
195+ if (windowTitle ) {
196+ backend .setWindowTitle (windowTitle );
197+ } else if (baseTitle ) {
198+ backend .setWindowTitle (baseTitle );
199+ }
186200 };
187201 });
188202
You can’t perform that action at this time.
0 commit comments