diff --git a/phone/src/Phone.tsx b/phone/src/Phone.tsx
index bdfc83f..264bf63 100644
--- a/phone/src/Phone.tsx
+++ b/phone/src/Phone.tsx
@@ -28,6 +28,7 @@ import { usePhoneVisibility } from './os/phone/hooks/usePhoneVisibility';
import { Snackbar } from './ui/components/Snackbar';
import { NotificationAlert } from './os/notifications/components/NotificationAlert';
import { useCallModal } from './os/call/hooks/useCallModal';
+import WindowSnackbar from './ui/components/WindowSnackbar';
function Phone() {
const { apps } = useApps();
@@ -53,6 +54,7 @@ function Phone() {
return (
+
{
+ const [open, setOpen] = useState
(false);
+ const [message, setMessage] = useState('');
+ const [severity, setSeverity] = useState<'info' | 'error' | 'success'>('info');
+
+ const classes = useStyles();
+
+ useNuiEvent('PHONE', 'startRestart', () => {
+ setMessage('Restarting UI');
+ setOpen(true);
+ setSeverity('error');
+ setTimeout(() => window.location.reload(), 3000);
+ });
+
+ const handleClose = () => {
+ setOpen(false);
+ };
+
+ return (
+
+
+ Phone - {message}
+
+
+ );
+};
+
+export default WindowSnackbar;
diff --git a/resources/client/cl_main.ts b/resources/client/cl_main.ts
index e8a928e..e24a467 100644
--- a/resources/client/cl_main.ts
+++ b/resources/client/cl_main.ts
@@ -46,15 +46,6 @@ const hidePhone = async (): Promise => {
* Register Command and Keybinding
*
* * * * * * * * * * * * */
-
-RegisterCommand(
- 'phone:close',
- async () => {
- await hidePhone();
- },
- false,
-);
-
RegisterCommand(
'phone',
async () => {
@@ -65,9 +56,16 @@ RegisterCommand(
);
RegisterCommand(
- 'phone:open',
+ 'phone:restart',
async () => {
- await showPhone();
+ await hidePhone();
+ SendNuiMessage(
+ JSON.stringify({
+ app: 'PHONE',
+ method: 'startRestart',
+ data: {},
+ }),
+ );
},
false,
);