@@ -15,12 +15,12 @@ const theme = useTheme();
1515
1616const restartProgram = async () => {
1717 if (await axiosPost (" /utils/restartProgram" , " restart PhotonVision" )) {
18- forceReloadPage ();
18+ await forceReloadPage ();
1919 }
2020};
2121const restartDevice = async () => {
2222 if (await axiosPost (" /utils/restartDevice" , " restart the device" )) {
23- forceReloadPage ();
23+ await forceReloadPage ();
2424 }
2525};
2626
@@ -36,7 +36,7 @@ const majorVersionRegex = new RegExp("(?:dev-)?(\\d+)\\.\\d+\\.\\d+");
3636
3737const offlineUpdateDialog = ref ({ show: false , confirmString: " " });
3838
39- const handleOfflineUpdateRequest = () => {
39+ const handleOfflineUpdateRequest = async () => {
4040 const files = offlineUpdate .value ?.files ;
4141 if (! files ) return ;
4242 if (files .length === 0 ) return ;
@@ -69,7 +69,7 @@ const handleOfflineUpdateRequest = () => {
6969 });
7070 return ;
7171 } else if (versionMatch && ! dev ) {
72- handleOfflineUpdate (files [0 ]);
72+ await handleOfflineUpdate (files [0 ]);
7373 } else if (! versionMatch && ! dev ) {
7474 offlineUpdateDialog .value = {
7575 show: true ,
@@ -119,7 +119,7 @@ const handleOfflineUpdate = async (file: File) => {
119119 color: " secondary" ,
120120 timeout: - 1
121121 });
122- forceReloadPage ();
122+ await forceReloadPage ();
123123 }
124124};
125125
@@ -145,7 +145,7 @@ const showImportDialog = ref(false);
145145const importType = ref <ImportType | undefined >(undefined );
146146const importFile = ref <File | null >(null );
147147
148- const handleSettingsImport = () => {
148+ const handleSettingsImport = async () => {
149149 if (importType .value === undefined || importFile .value === null ) return ;
150150 const formData = new FormData ();
151151 formData .append (" data" , importFile .value );
@@ -168,7 +168,7 @@ const handleSettingsImport = () => {
168168 settingsEndpoint = " " ;
169169 break ;
170170 }
171- axiosPost (` /settings${settingsEndpoint } ` , " import settings" , formData , {
171+ await axiosPost (` /settings${settingsEndpoint } ` , " import settings" , formData , {
172172 headers: { " Content-Type" : " multipart/form-data" }
173173 });
174174 showImportDialog .value = false ;
@@ -179,7 +179,7 @@ const handleSettingsImport = () => {
179179const showFactoryReset = ref (false );
180180const nukePhotonConfigDirectory = async () => {
181181 if (await axiosPost (" /utils/nukeConfigDirectory" , " delete the config directory" )) {
182- forceReloadPage ();
182+ await forceReloadPage ();
183183 }
184184};
185185
0 commit comments