Skip to content

Commit

Permalink
feat: additional changes for implementation of new preview command
Browse files Browse the repository at this point in the history
  • Loading branch information
neoandmatrix committed Feb 28, 2025
1 parent 246b4bd commit 2d23320
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit 2d23320

Please # to comment.