Skip to content

Commit

Permalink
fix: layer manager
Browse files Browse the repository at this point in the history
  • Loading branch information
AyushAgrawal-A2 committed Jan 23, 2024
1 parent 6768c26 commit 1354a42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/blocks/src/surface-block/managers/layer-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ export class LayerManager {
props?: Record<string, unknown>
) {
let updateType: 'block' | 'canvas' | undefined = undefined;
const type = 'type' in element ? element.type : element.flavour;
const type = 'flavour' in element ? element.flavour : element.type;

const indexChanged = !props || 'index' in props;
const updateArray = (array: EdgelessModel[], element: EdgelessModel) => {
Expand Down Expand Up @@ -595,7 +595,7 @@ export class LayerManager {

add(element: EdgelessModel) {
let insertType: 'block' | 'canvas' | undefined = undefined;
const type = 'type' in element ? element.type : element.flavour;
const type = 'flavour' in element ? element.flavour : element.type;

if (!type.startsWith('affine:')) {
insertType = 'canvas';
Expand Down

0 comments on commit 1354a42

Please sign in to comment.