mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
🎨 transaction
This commit is contained in:
parent
210139a26c
commit
eed539a34e
2 changed files with 6 additions and 1 deletions
|
|
@ -313,7 +313,7 @@ const getUnInitTab = (options: IOpenFileOptions) => {
|
||||||
item.headElement.setAttribute("data-initdata", JSON.stringify(initObj));
|
item.headElement.setAttribute("data-initdata", JSON.stringify(initObj));
|
||||||
item.parent.switchTab(item.headElement);
|
item.parent.switchTab(item.headElement);
|
||||||
return true;
|
return true;
|
||||||
} else if (initObj.instance === "Custom" && options.custom && objEquals(initObj.customModelData, options.custom.data)) {
|
} else if (initObj.instance === "Custom" && options.custom && objEquals(initObj.customModelData, options.custom.data)) {
|
||||||
item.parent.switchTab(item.headElement);
|
item.parent.switchTab(item.headElement);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -316,11 +316,13 @@ const updateEmbed = (protyle: IProtyle, operation: IOperation) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const promiseTransactions = () => {
|
export const promiseTransactions = () => {
|
||||||
|
window.clearInterval(window.siyuan.transactionsTimeout);
|
||||||
window.siyuan.transactionsTimeout = window.setInterval(() => {
|
window.siyuan.transactionsTimeout = window.setInterval(() => {
|
||||||
if (window.siyuan.transactions.length === 0) {
|
if (window.siyuan.transactions.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window.clearInterval(window.siyuan.transactionsTimeout);
|
window.clearInterval(window.siyuan.transactionsTimeout);
|
||||||
|
window.siyuan.transactionsTimeout = undefined;
|
||||||
promiseTransaction();
|
promiseTransaction();
|
||||||
}, Constants.TIMEOUT_INPUT * 2);
|
}, Constants.TIMEOUT_INPUT * 2);
|
||||||
};
|
};
|
||||||
|
|
@ -930,6 +932,9 @@ export const transaction = (protyle: IProtyle, doOperations: IOperation[], undoO
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
protyle.transactionTime = time;
|
protyle.transactionTime = time;
|
||||||
|
if (typeof window.siyuan.transactionsTimeout === "undefined") {
|
||||||
|
promiseTransactions();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const updateTransaction = (protyle: IProtyle, id: string, newHTML: string, html: string) => {
|
export const updateTransaction = (protyle: IProtyle, id: string, newHTML: string, html: string) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue