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
|
|
@ -316,11 +316,13 @@ const updateEmbed = (protyle: IProtyle, operation: IOperation) => {
|
|||
};
|
||||
|
||||
export const promiseTransactions = () => {
|
||||
window.clearInterval(window.siyuan.transactionsTimeout);
|
||||
window.siyuan.transactionsTimeout = window.setInterval(() => {
|
||||
if (window.siyuan.transactions.length === 0) {
|
||||
return;
|
||||
}
|
||||
window.clearInterval(window.siyuan.transactionsTimeout);
|
||||
window.siyuan.transactionsTimeout = undefined;
|
||||
promiseTransaction();
|
||||
}, Constants.TIMEOUT_INPUT * 2);
|
||||
};
|
||||
|
|
@ -930,6 +932,9 @@ export const transaction = (protyle: IProtyle, doOperations: IOperation[], undoO
|
|||
});
|
||||
}
|
||||
protyle.transactionTime = time;
|
||||
if (typeof window.siyuan.transactionsTimeout === "undefined") {
|
||||
promiseTransactions();
|
||||
}
|
||||
};
|
||||
|
||||
export const updateTransaction = (protyle: IProtyle, id: string, newHTML: string, html: string) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue