Skip to content

Commit 1994819

Browse files
committed
fixes
1 parent 13acfe9 commit 1994819

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

editor/src/app/components/layout/context-actions/context-actions.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import { map } from 'rxjs/operators';
4141
selector: 'scl-context-actions',
4242
templateUrl: './context-actions.component.html',
4343
styleUrls: ['./context-actions.component.scss'],
44-
changeDetection: ChangeDetectionStrategy.OnPush,
4544
standalone: false,
4645
})
4746
export class ContextActionsComponent {

editor/src/app/components/layout/context-view/context-view.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import { ContextEditSessionService } from '../context-edit-session.service';
2828
selector: 'scl-context-view',
2929
templateUrl: './context-view.component.html',
3030
styleUrls: ['./context-view.component.scss'],
31-
changeDetection: ChangeDetectionStrategy.OnPush,
3231
standalone: false,
3332
})
3433
export class ContextViewComponent {

editor/src/app/state/scm/actions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ export const loadScmMapSuccess = createAction(
3636
props<{ game: Game; map: ScmMap }>(),
3737
);
3838

39+
export const loadScmMapError = createAction(
40+
'[SCM] Load Map Error',
41+
props<{ game: Game }>(),
42+
);
43+
3944
export const selectScmLabelOffset = createAction(
4045
'[SCM] Select Label Offset',
4146
props<{ offset: number }>(),

editor/src/app/state/scm/effects.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
map,
88
switchMap,
99
take,
10+
filter,
1011
withLatestFrom,
1112
} from 'rxjs/operators';
1213
import { ScmMap } from 'src/app/components/scm/model';
@@ -15,6 +16,7 @@ import {
1516
loadScmFile,
1617
loadScmFileSuccess,
1718
loadScmMap,
19+
loadScmMapError,
1820
loadScmMapSuccess,
1921
loadScmOverlay,
2022
loadScmOverlaySuccess,
@@ -66,7 +68,7 @@ export class ScmEffects {
6668
switchMap(() =>
6769
this._facade.map$.pipe(
6870
map((scmMap) => {
69-
const mainEntry = scmMap!.files.find((f) => f.pid === 0);
71+
const mainEntry = scmMap.files.find((f) => f.pid === 0);
7072
const mainFileName = mainEntry!.path.replace(/\.json$/, '');
7173
return loadScmFile({ name: mainFileName });
7274
}),
@@ -111,9 +113,7 @@ export class ScmEffects {
111113

112114
return this._service.loadMap(game).pipe(
113115
map((mapData) => loadScmMapSuccess({ game, map: mapData })),
114-
catchError(() =>
115-
of(loadScmMapSuccess({ game, map: this._emptyMap })),
116-
),
116+
catchError(() => of(loadScmMapError({ game }))),
117117
);
118118
}),
119119
),

0 commit comments

Comments
 (0)