alex/auto-undo-redo: fix

pull/3364/head
alex 2024-04-24 16:21:55 +01:00
rodzic e341dbea06
commit 5ec172f3cd
3 zmienionych plików z 20 dodań i 18 usunięć

Wyświetl plik

@ -7861,22 +7861,24 @@ export class Editor extends EventEmitter<TLEventMap> {
}
// todo: We only have to do this if there are multiple users in the document
this.store.put([
{
id: TLPOINTER_ID,
typeName: 'pointer',
x: currentPagePoint.x,
y: currentPagePoint.y,
lastActivityTimestamp:
// If our pointer moved only because we're following some other user, then don't
// update our last activity timestamp; otherwise, update it to the current timestamp.
info.type === 'pointer' && info.pointerId === INTERNAL_POINTER_IDS.CAMERA_MOVE
? this.store.unsafeGetWithoutCapture(TLPOINTER_ID)?.lastActivityTimestamp ??
this._tickManager.now
: this._tickManager.now,
meta: {},
},
])
this.history.ignore(() => {
this.store.put([
{
id: TLPOINTER_ID,
typeName: 'pointer',
x: currentPagePoint.x,
y: currentPagePoint.y,
lastActivityTimestamp:
// If our pointer moved only because we're following some other user, then don't
// update our last activity timestamp; otherwise, update it to the current timestamp.
info.type === 'pointer' && info.pointerId === INTERNAL_POINTER_IDS.CAMERA_MOVE
? this.store.unsafeGetWithoutCapture(TLPOINTER_ID)?.lastActivityTimestamp ??
this._tickManager.now
: this._tickManager.now,
meta: {},
},
])
})
}
/**

Wyświetl plik

@ -96,7 +96,7 @@ export function logHistory(history: HistoryManager<any>) {
for (const undo of undos) {
if (!undo) continue
if (undo.type === 'stop') {
p.log('- Stop', undo.id)
p.log('Stop', undo.id)
} else {
p.log('- Diff')
p.indent()

Wyświetl plik

@ -142,12 +142,12 @@ export const InstancePageStateRecordType = createRecordType<TLInstancePageState>
pageId: false,
selectedShapeIds: false,
editingShapeId: false,
croppingShapeId: false,
meta: false,
hintingShapeIds: true,
erasingShapeIds: true,
hoveredShapeId: true,
croppingShapeId: true,
focusedGroupId: true,
},
}