mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
JS-5769: fix
This commit is contained in:
parent
3c61d189f6
commit
59a8499054
2 changed files with 2 additions and 31 deletions
|
@ -244,7 +244,6 @@ class Dispatcher {
|
|||
|
||||
if (id == rootId) {
|
||||
S.Block.checkBlockType(rootId);
|
||||
S.Block.checkBlockChat(rootId);
|
||||
};
|
||||
|
||||
updateParents = true;
|
||||
|
@ -816,7 +815,6 @@ class Dispatcher {
|
|||
|
||||
S.Detail.delete(rootId, id, keys);
|
||||
S.Block.checkBlockType(rootId);
|
||||
S.Block.checkBlockChat(rootId);
|
||||
|
||||
updateMarkup = true;
|
||||
break;
|
||||
|
@ -1073,7 +1071,6 @@ class Dispatcher {
|
|||
};
|
||||
|
||||
S.Block.checkBlockType(rootId);
|
||||
S.Block.checkBlockChat(rootId);
|
||||
};
|
||||
|
||||
if (undefined !== details.setOf) {
|
||||
|
@ -1178,7 +1175,6 @@ class Dispatcher {
|
|||
S.Block.updateNumbers(contextId);
|
||||
S.Block.updateMarkup(contextId);
|
||||
S.Block.checkBlockType(contextId);
|
||||
S.Block.checkBlockChat(contextId);
|
||||
|
||||
keyboard.setWindowTitle();
|
||||
};
|
||||
|
|
|
@ -585,8 +585,9 @@ class BlockStore {
|
|||
checkBlockType (rootId: string) {
|
||||
const { header, type } = J.Constant.blockId;
|
||||
const element = this.getMapElement(rootId, header);
|
||||
const canWrite = U.Space.canMyParticipantWrite();
|
||||
|
||||
if (!element) {
|
||||
if (!element || !canWrite) {
|
||||
return;
|
||||
};
|
||||
|
||||
|
@ -606,32 +607,6 @@ class BlockStore {
|
|||
return header ? header.childrenIds.includes(J.Constant.blockId.type) : false;
|
||||
};
|
||||
|
||||
checkBlockChat (rootId: string) {
|
||||
return;
|
||||
|
||||
const element = this.getMapElement(rootId, rootId);
|
||||
|
||||
if (!element) {
|
||||
return;
|
||||
};
|
||||
|
||||
const object = S.Detail.get(rootId, rootId, [ 'layout', 'chatId' ], true);
|
||||
if (U.Object.isChatLayout(object.layout)) {
|
||||
return;
|
||||
};
|
||||
|
||||
if (object.chatId && !this.checkBlockChatExists(rootId)) {
|
||||
const childrenIds = element.childrenIds.concat(J.Constant.blockId.chat);
|
||||
|
||||
this.updateStructure(rootId, rootId, childrenIds);
|
||||
};
|
||||
};
|
||||
|
||||
checkBlockChatExists (rootId: string): boolean {
|
||||
const element = this.getMapElement(rootId, rootId);
|
||||
return element ? element.childrenIds.includes(J.Constant.blockId.chat) : false;
|
||||
};
|
||||
|
||||
getLayoutIds (rootId: string, ids: string[]) {
|
||||
if (!ids.length) {
|
||||
return [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue