Fix assignment bug in projects service

This commit is contained in:
Mattias Granlund 2023-11-24 13:49:38 +01:00
parent ccc7405aa7
commit 94e2ce108a

View File

@ -1,6 +1,6 @@
import { invoke } from '$lib/backend/ipc';
import type { Project as CloudProject } from '$lib/backend/cloud';
import { BehaviorSubject, Observable, catchError, from, map, shareReplay, switchMap } from 'rxjs';
import { BehaviorSubject, catchError, from, map, shareReplay, switchMap } from 'rxjs';
export type Key =
| 'generated'
@ -34,7 +34,7 @@ export class ProjectService {
getProject(projectId: string) {
return this.projects$.pipe(
map((projects) => {
const project = projects.find((p) => (p.id = projectId));
const project = projects.find((p) => p.id == projectId);
if (!project) {
// We need to abort loading of /[projectId]/ if no project exists, such
// that the type here is of Project rather than Project | undefined.