Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: additional changes for implementation of new preview command #1167

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
8 changes: 7 additions & 1 deletion apps/studio/src/services/socket-client.service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import toast from 'react-hot-toast';
import { appState } from '@/state';

interface IncomingMessage {
type: 'file:loaded' | 'file:changed' | 'file:deleted';
type: 'file:loaded' | 'file:changed' | 'file:deleted' | 'mode:preview';
code?: string;
}

Expand Down Expand Up @@ -59,6 +59,12 @@ export class SocketClient extends AbstractService {
case 'file:deleted':
console.warn('Live Server: The file has been deleted on the file system.');
break;
case 'mode:preview':
appState.setState({
readOnly: true,
initialized: true,
});
break;
default:
console.warn('Live Server: An unknown even has been received. See details:');
console.log(json);
Expand Down