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
2 changes: 1 addition & 1 deletion typescript/packages/common-memory/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const integrate = (session: Session, change: In<State>) => {
if (session.controller) {
session.controller.enqueue(change);
} else {
throw new Error("Subscription is cancelled");
console.warn("Subscription is cancelled, not integrating change", change);
}
};

Expand Down
12 changes: 11 additions & 1 deletion typescript/packages/jumble/src/contexts/CharmManagerContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@ const CharmManagerContext = createContext<CharmManagerContextType>(null!);

export const CharmsManagerProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
const { replicaName } = useParams<{ replicaName: string }>();
const effectiveReplica = replicaName || "common-knowledge";

let effectiveReplica: string;
if (replicaName) {
// When a replica is provided in the URL, use it and save it as the last visited
effectiveReplica = replicaName;
localStorage.setItem("lastReplica", replicaName);
} else {
// Otherwise, pull the last visited replica from local storage.
// Falling back to "common-knowledge" if nothing was stored.
effectiveReplica = localStorage.getItem("lastReplica") || "common-knowledge";
}

const charmManager = useMemo(() => {
const storageType = (import.meta as any).env.VITE_STORAGE_TYPE ?? "remote";
Expand Down
Loading