Skip to content
This repository was archived by the owner on Dec 25, 2025. It is now read-only.
Next Next commit
Update to support latest p2panda-js version
  • Loading branch information
adzialocha committed Dec 23, 2021
commit ec7747837e8a83223c6a3e6c69fe3d7886827c24
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const App = (): JSX.Element => {
const syncEntries = async () => {
const unsortedEntries = await session.queryEntries(CHAT_SCHEMA);
setEntries(
unsortedEntries.sort(({ message: messageA }, { message: messageB }) => {
return messageA.fields.date > messageB.fields.date ? 1 : -1;
unsortedEntries.sort(({ operation: operationA }, { operation: operationB }) => {
return operationA.fields.date > operationB.fields.date ? 1 : -1;
}),
);
};
Expand Down
8 changes: 4 additions & 4 deletions src/components/BambooLog/LogEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const formatMessage = (message: string): string => {
};

export const LogEntry = ({ entry }: Props): JSX.Element => {
const { message, entryHashBacklink, entryHashSkiplink } = entry;
const { operation, entryHashBacklink, entryHashSkiplink } = entry;
return (
<div className="flex-column">
<div className="entry-data flex-row">
Expand All @@ -28,10 +28,10 @@ export const LogEntry = ({ entry }: Props): JSX.Element => {
</div>
<div className="entry-content flex-row">
<div className="flex-column">
<b>{message.action}</b>
<b>{operation.action}</b>
<ul>
<li>Schema: {formatCheckHash(message.schema)}</li>
<li>Message: {formatMessage(message.fields.message)}</li>
<li>Schema: {formatCheckHash(operation.schema)}</li>
<li>Message: {formatMessage(operation.fields.message)}</li>
<li>BackLink: {formatCheckHash(entryHashBacklink)}</li>
<li>SkipLink: {formatCheckHash(entryHashSkiplink)}</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Chatlog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const Chatlog = ({
onClick={() => setDebugEntry(entry)}
>
<h3 className="message">
{formatAuthor(entry.encoded)}: {entry.message.fields.message}
{formatAuthor(entry.encoded)}: {entry.operation.fields.message}
</h3>
</div>
))}
Expand Down
2 changes: 1 addition & 1 deletion src/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

export const ENDPOINT = 'http://localhost:2020';
export const CHAT_SCHEMA =
'0040cf94f6d605657e90c543b0c919070cdaaf7209c5e1ea58acb8f3568fa2114268dc9ac3bafe12af277d286fce7dc59b7c0c348973c4e9dacbe79485e56ac2a702';
'00200cf84048b0798942deba7b1b9fcd77ca72876643bd3fedfe612d4c6fb60436be';