fix(native): split application & tappable application (#10491)

A listening tappable app's info should inherit from its group process's name/icon. However the group process may not be listed as a tappable application.
This commit is contained in:
pengx17
2025-02-27 15:02:38 +00:00
parent c50184bee6
commit 9e0cae58d7
22 changed files with 975 additions and 313 deletions
@@ -15,14 +15,14 @@ export function AppItem({ app, recordings }: AppItemProps) {
const appName = app.rootApp.name || '';
const bundleId = app.rootApp.bundleIdentifier || '';
const firstLetter = appName.charAt(0).toUpperCase();
const isRunning = app.apps.some(a => a.running);
const isRunning = app.apps.some(a => a.isRunning);
const recording = recordings?.find((r: RecordingStatus) =>
app.apps.some(a => a.processId === r.processId)
);
const handleRecordClick = React.useCallback(() => {
const recordingApp = app.apps.find(a => a.running);
const recordingApp = app.apps.find(a => a.isRunning);
if (!recordingApp) {
return;
}
@@ -24,12 +24,13 @@ export function AppList() {
});
socket.on('apps:state-changed', data => {
const index = apps.findIndex(a => a.processId === data.processId);
console.log('apps:state-changed', data, index);
if (index !== -1) {
next(
null,
apps.toSpliced(index, 1, {
...apps[index],
running: data.running,
isRunning: data.isRunning,
})
);
}
@@ -83,10 +84,10 @@ export function AppList() {
}, [apps]);
const runningApps = (appGroups || []).filter(app =>
app.apps.some(a => a.running)
app.apps.some(a => a.isRunning)
);
const notRunningApps = (appGroups || []).filter(
app => !app.apps.some(a => a.running)
app => !app.apps.some(a => a.isRunning)
);
return (