Skip to content

Commit f028ba2

Browse files
committed
Finder tweaks
1 parent ddf5a8f commit f028ba2

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

src/app/Applications/News/News.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ const News: React.FC = () => {
243243
{entry.title}
244244
</h1>
245245
</a>
246-
<br />
247246
<span
248247
style={{
249248
fontFamily: 'var(--ui-font)',

src/app/SystemFolder/ControlPanels/AppManager/ClassicyAppManager.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,12 @@ export const classicyAppEventHandler = (ds: ClassicyStore, action) => {
194194
}
195195
case 'ClassicyAppClose': {
196196
handler.closeApp(ds, action.app.id)
197-
const lastOpenApp = () => {
198-
const openApps = Object.values(ds.System.Manager.App.apps).find((value) => {
199-
return value.open === true
200-
})
201-
return openApps[0]?.id
197+
const lastOpenApp = Object.values(ds.System.Manager.App.apps).find((value) => {
198+
return value.open === true
199+
})
200+
if (lastOpenApp) {
201+
handler.focusApp(ds, lastOpenApp.id)
202202
}
203-
handler.focusApp(ds, lastOpenApp())
204203
break
205204
}
206205
case 'ClassicyAppFocus': {

src/app/SystemFolder/Finder/Finder.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ const Finder = () => {
2020
const [pathSettings, setPathSettings] = useState<Record<string, PathSettingsProps>>({})
2121
const [showAbout, setShowAbout] = useState(false)
2222

23+
const { openPaths } = desktop.System.Manager.App.apps[appId]?.data || {}
24+
2325
useEffect(() => {
2426
const appData = desktop.System.Manager.App.apps[appId]?.data || {}
2527
if (!appData?.hasOwnProperty('openPaths')) {
@@ -121,8 +123,6 @@ const Finder = () => {
121123
)
122124
}
123125

124-
const { openPaths } = desktop.System.Manager.App.apps[appId]?.data || {}
125-
126126
return (
127127
<ClassicyApp
128128
id={appId}

src/app/SystemFolder/SystemResources/Desktop/ClassicyDesktopIcon.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ const ClassicyDesktopIcon: React.FC<ClassicyDesktopIconProps> = ({
9797
let thisLocation = getIconLocation()
9898

9999
const isLaunched = () => {
100+
// Check if a Finder window is open
101+
if (appId.startsWith('Finder.app')) {
102+
const a = desktopContext.System.Manager.App.apps['Finder.app'].windows.findIndex(
103+
(w) => w.id === eventData.path && w.closed === false
104+
)
105+
return a >= 0
106+
}
100107
return desktopContext.System.Manager.App.apps[appId]?.open
101108
}
102109

0 commit comments

Comments
 (0)