Skip to content

Commit

Permalink
Merge pull request #38 from near-everything/fix/isReadOnly
Browse files Browse the repository at this point in the history
fix: readonly when canvas not found
  • Loading branch information
elliotBraem authored Apr 30, 2024
2 parents 50f1381 + ca41e2f commit b933a86
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions apps/canvas/widget/index.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/**
* This should be primary view
*/

const path = props.path || context.accountId || "every.near";

const parts = path.split("/");

if (parts.length === 1) {
path = `${path}/canvas/main`;
}
Expand Down Expand Up @@ -33,7 +31,7 @@ if (hyperfile.adapter) {
console.log(`Invalid data: ${hyperfile}`);
return (
<Container key={path}>
<Canvas persistance={path} autoFocus={true} isReadOnly={true} />
<Canvas persistance={path} autoFocus={true} isReadOnly={!(creatorId === context.accountId)} />
</Container>
);
}
Expand All @@ -42,7 +40,7 @@ if (creatorId === context.accountId) {
// use local persistance
return (
<Container key={path}>
<Canvas persistance={path} autoFocus={true} />
<Canvas persistance={path} autoFocus={true} isReadOnly={false} />
</Container>
);
}
Expand Down

0 comments on commit b933a86

Please sign in to comment.