Skip to content

Commit 399ae9d

Browse files
committed
Exclusively use API reported block schemas to determine if a block is implemented
1 parent abab226 commit 399ae9d

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

webapp/src/server_fetch_utils.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,11 +531,9 @@ export async function updateBlockFromServer(
531531
block_id: block_id,
532532
isSaved: response_json.saved_successfully,
533533
});
534-
store.commit("setBlockImplementationError", { block_id, hasError: false });
535534
})
536535
.catch((error) => {
537536
console.warn(`Failed to update block ${block_id}:`, error);
538-
store.commit("setBlockImplementationError", { block_id, hasError: true });
539537
store.commit("setBlockNotUpdating", block_id);
540538
});
541539
}

webapp/src/store/index.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,6 @@ export default createStore({
362362
].filter((item) => !refcodes.includes(item.refcode));
363363
}
364364
},
365-
setBlockImplementationError(state, { block_id, hasError }) {
366-
if (hasError) {
367-
state.block_implementation_errors[block_id] = true;
368-
} else {
369-
delete state.block_implementation_errors[block_id];
370-
}
371-
},
372365
},
373366
getters: {
374367
getItem: (state) => (item_id) => {

webapp/src/views/EditPage.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,11 @@ export default {
266266
});
267267
},
268268
getBlockDisplayType(block_id) {
269-
if (this.$store.state.block_implementation_errors[block_id]) {
270-
return NotImplementedBlock;
271-
}
272-
273269
const block = this.blocks[block_id];
274-
if (!block || !block.blocktype) {
270+
if (!(block.blocktype in this.$store.state.blocksInfos)) {
271+
console.log(
272+
`Block with type ${block.blocktype} does not have a valid blocktype or is not in blocksInfos.`,
273+
);
275274
return NotImplementedBlock;
276275
}
277276

0 commit comments

Comments
 (0)