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
29 changes: 28 additions & 1 deletion frontend/src/components/Canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function Canvas({
viewOnly = false,
isOwner = false,
roomType = 'public',
walletConnected = false,
}) {
const canvasRef = useRef(null);
const snapshotRef = useRef(null);
Expand Down Expand Up @@ -1708,7 +1709,13 @@ function Canvas({
// When historyMode is active, a specific user is selected for replay, or
// when viewOnly is true (room is archived or user is a viewer), editing
// should be disabled.
const editingEnabled = !(historyMode || (selectedUser && selectedUser !== "") || viewOnly);
// For secure rooms, wallet must be connected to allow editing.
const editingEnabled = !(
historyMode ||
(selectedUser && selectedUser !== "") ||
viewOnly ||
(roomType === 'secure' && !walletConnected)
);

return (
<div className="Canvas-wrapper" style={{ pointerEvents: "auto" }}>
Expand Down Expand Up @@ -1790,6 +1797,26 @@ function Canvas({
</Box>
)}

{/* Wallet disconnected banner - visible when secure room wallet is not connected */}
{roomType === 'secure' && !walletConnected && (
<Box
sx={{
position: 'absolute',
top: 56,
left: '50%',
transform: 'translateX(-50%)',
zIndex: 2200,
pointerEvents: 'none',
}}
>
<Paper elevation={6} sx={{ px: 2, py: 0.5, bgcolor: 'rgba(255, 152, 0, 0.9)', color: 'white', borderRadius: 1 }}>
<Typography variant="caption" sx={{ fontWeight: 'bold', letterSpacing: 0.5 }}>
⚠ Wallet Not Connected — Canvas Locked
</Typography>
</Paper>
</Box>
)}

{/* Confirm Destructive Delete dialog (owner-only) */}
<Dialog open={confirmDestructiveOpen} onClose={() => { setConfirmDestructiveOpen(false); setDestructiveConfirmText(''); }}>
<DialogTitle>Permanently delete room</DialogTitle>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/pages/Room.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export default function Room({ auth }) {
viewOnly={viewOnly}
isOwner={isOwner}
roomType={info?.type || 'public'}
walletConnected={walletConnected}
onOpenSettings={((info && ((info.myRole || 'editor') !== 'viewer')) ? (() => navigate(`/rooms/${roomId}/settings`)) : null)}
/>
</Box>
Expand Down
Loading