Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@ export function RoomStatus({ className, ...props }: ComponentProps<"div">) {
const statusContent = useMemo(() => {
switch (currentStatus) {
case "connected":
case "open": // Sent by old clients (prior to 1.1)
return <Ping className="text-green-500 dark:text-green-400" />;

case "connecting":
case "reconnecting":
case "authenticating": // Sent by old clients (prior to 1.1)
case "unavailable": // Sent by old clients (prior to 1.1)
return <Ping className="text-orange-500 dark:text-orange-400" />;

case "disconnected":
case "closed": // Sent by old clients (prior to 1.1)
case "failed": // Sent by old clients (prior to 1.1)
return (
<Ping className="text-red-500 dark:text-red-400" animate={false} />
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export type YUpdate = {
ds: DeleteSet;
structs: (Y.Item | Y.GC | Skip)[];
};

type Room = {
readonly roomId: string;
status: Status | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ export function EventTimeline({ className, ...props }: ComponentProps<"div">) {
const currentStatus = useStatus();
const [customEvents, clearCustomEvents] = useCustomEvents();

if (
currentStatus === "connected" ||
currentStatus === "open" || // Same as "connected", but only sent by old clients (prior to 1.1)
currentStatus === "reconnecting"
) {
if (currentStatus === "connected" || currentStatus === "reconnecting") {
if (customEvents.length > 0) {
return (
<div className={cx(className, "absolute inset-0")} {...props}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ export function Presence({ className, ...props }: ComponentProps<"div">) {
const currentStatus = useStatus();
const presence = usePresence();

if (
currentStatus === "connected" ||
currentStatus === "open" || // Same as "connected", but only sent by old clients (prior to 1.1)
currentStatus === "reconnecting"
) {
if (currentStatus === "connected" || currentStatus === "reconnecting") {
if (presence.length > 0) {
return (
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ export function Storage({
[]
);

if (
currentStatus === "connected" ||
currentStatus === "open" || // Same as "connected", but only sent by old clients (prior to 1.1)
currentStatus === "reconnecting"
) {
if (currentStatus === "connected" || currentStatus === "reconnecting") {
if (filteredStorage.length > 0) {
return (
<div className={cx(className, "absolute inset-0")} {...props}>
Expand Down
18 changes: 3 additions & 15 deletions tools/liveblocks-devtools/src/devtools/tabs/yjs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ function YjsChangesList({ className, ...props }: ComponentProps<"div">) {
const updates = useYUpdates();
const tree = useMemo(() => createTreeFromYUpdates(updates), [updates]);

if (
currentStatus === "connected" ||
currentStatus === "open" || // Same as "connected", but only sent by old clients (prior to 1.1)
currentStatus === "reconnecting"
) {
if (currentStatus === "connected" || currentStatus === "reconnecting") {
if (updates.length > 0) {
return (
<div
Expand Down Expand Up @@ -146,11 +142,7 @@ function YjsDocument({
[]
);

if (
currentStatus === "connected" ||
currentStatus === "open" || // Same as "connected", but only sent by old clients (prior to 1.1)
currentStatus === "reconnecting"
) {
if (currentStatus === "connected" || currentStatus === "reconnecting") {
if (filteredNode.length > 0) {
return (
<div className={cx(className, "absolute inset-0")} {...props}>
Expand Down Expand Up @@ -220,11 +212,7 @@ function YjsAwareness({ className, ...props }: ComponentProps<"div">) {
[presence]
);

if (
currentStatus === "connected" ||
currentStatus === "open" || // Same as "connected", but only sent by old clients (prior to 1.1)
currentStatus === "reconnecting"
) {
if (currentStatus === "connected" || currentStatus === "reconnecting") {
if (presence.length > 0 && hasAwareness) {
return (
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,7 @@ export function YFlow({ className, ...props }: ComponentProps<"div">) {

if (
!isTransitionPending &&
(currentStatus === "connected" ||
currentStatus === "open" || // Same as "connected", but only sent by old clients (prior to 1.1)
currentStatus === "reconnecting")
(currentStatus === "connected" || currentStatus === "reconnecting")
) {
if (edges.length > 0) {
return (
Expand Down
Loading