| 13 | type HarExport = Omit<InsomniaExport, 'format'>; |
| 14 | |
| 15 | const getWorkspaces = (activeProjectId?: string) => { |
| 16 | if (activeProjectId) { |
| 17 | return services.workspace.listByParentId(activeProjectId); |
| 18 | } |
| 19 | // This code path was kept in case there was ever a time when the app wouldn't have an active project. |
| 20 | // In over 5 months of monitoring in production, we never saw this happen. |
| 21 | // Keeping it for defensive purposes, but it's not clear if it's necessary. |
| 22 | return services.workspace.list(); |
| 23 | }; |
| 24 | |
| 25 | // Only in the case of running unit tests from Inso can activeProjectId be undefined. This is because the concept of a project doesn't exist in git/insomnia sync or an export file |
| 26 | export const init = (activeProjectId?: string) => ({ |