chore: Refactor upload placeholder (#5898)

This commit is contained in:
Tom Moor
2023-09-28 23:13:40 -04:00
committed by GitHub
parent f4fd9dae5f
commit 5397907599
7 changed files with 135 additions and 155 deletions

View File

@@ -0,0 +1,15 @@
import { ySyncPluginKey } from "@getoutline/y-prosemirror";
import { Transaction } from "prosemirror-state";
/**
* Checks if a transaction is a remote transaction
*
* @param tr The Prosemirror transaction
* @returns true if the transaction is a remote transaction
*/
export function isRemoteTransaction(tr: Transaction): boolean {
const meta = tr.getMeta(ySyncPluginKey);
// This logic seems to be flipped? But it's correct.
return !!meta?.isChangeOrigin;
}