Skip to content

Commit

Permalink
Merge branch 'main' into releases/0.0.43
Browse files Browse the repository at this point in the history
  • Loading branch information
Kitenite committed Oct 15, 2024
2 parents 9afca32 + 29270d5 commit da88fa1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
10 changes: 8 additions & 2 deletions app/src/lib/editor/engine/code/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export class CodeManager {
}

async write(action: Action) {
// TODO: These can all be processed at once at the getCodeDiffRequests level
this.writeQueue.push(action);
if (!this.isExecuting) {
await this.processWriteQueue();
Expand All @@ -65,13 +66,18 @@ export class CodeManager {

private async processWriteQueue() {
this.isExecuting = true;
while (this.writeQueue.length > 0) {
if (this.writeQueue.length > 0) {
const action = this.writeQueue.shift();
if (action) {
await this.executeWrite(action);
}
}
this.isExecuting = false;
setTimeout(() => {
this.isExecuting = false;
if (this.writeQueue.length > 0) {
this.processWriteQueue();
}
}, 1000);
}

private async executeWrite(action: Action) {
Expand Down
11 changes: 10 additions & 1 deletion app/src/routes/editor/EditPanel/inputs/compound/BorderInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,16 @@ const BorderInput = observer(({ compoundStyle }: { compoundStyle: CompoundStyle
}

setShowGroup(!colorIsEmpty);
editorEngine.style.updateElementStyle('borderWidth', newBorderWidth);
if (newBorderWidth !== originalBorderWidth) {
const inTransaction = editorEngine.history.isInTransaction;
if (inTransaction) {
editorEngine.history.commitTransaction();
}
editorEngine.style.updateElementStyle('borderWidth', newBorderWidth);
if (inTransaction) {
editorEngine.history.startTransaction();
}
}
};

function renderTopInput() {
Expand Down

0 comments on commit da88fa1

Please sign in to comment.