Remove console logs

This commit is contained in:
Piotr Rogowski 2022-10-25 21:47:48 +02:00
parent 62f078581d
commit d764e83a44
No known key found for this signature in database
GPG Key ID: 4A842D702D9C6F8F
6 changed files with 2 additions and 22 deletions

View File

@ -191,8 +191,7 @@ const Dialog = ({
return;
}
// TODO: Sentry?
console.info('Unable to resolve panel:', panelName);
console.warn('Unable to resolve panel:', panelName);
return;
}

View File

@ -163,11 +163,6 @@ const AuthProvider = (props: { children: ReactNode }) => {
const storeUnsubscribe = client.authStore.onChange((_token, model) => {
setCurrentUser(model as User | null);
if (model) {
console.info('Logged in as', model.email);
} else {
console.info('Logged out');
}
});
client.realtime.subscribe(Collections.Tunes, (event) => {

View File

@ -213,7 +213,6 @@ const Logs = ({
});
break;
case 'metrics':
console.info(`Log parsed in ${data.elapsed}ms`);
setParseElapsed(msToTime(data.elapsed!));
setSamplesCount(data.records!);
setStep(2);

View File

@ -402,9 +402,8 @@ const UploadPage = () => {
const loadExistingTune = useCallback(async (currentTuneId: string) => {
setNewTuneId(currentTuneId);
console.info('Using tuneId:', currentTuneId);
const oldTune = await getTune(currentTuneId);
if (oldTune) {
// this is someone elses tune
if (oldTune.user !== currentUser?.id) {

View File

@ -28,9 +28,6 @@ const setTuneId = createAction<string>('navigation/tuneId');
const loadLogs = createAction<LogsState>('logs/load');
const loadToothLogs = createAction<ToothLogsState>('toothLogs/load');
// status bar
const setStatus = createAction<string>('status');
// ui
const setSidebarCollapsed = createAction<boolean>('ui/sidebarCollapsed');
const toggleSidebar = createAction('ui/toggleSidebar');
@ -81,9 +78,6 @@ const rootReducer = createReducer(initialState, (builder) => {
.addCase(toggleSidebar, (state: AppState) => {
state.ui.sidebarCollapsed = !state.ui.sidebarCollapsed;
})
.addCase(setStatus, (state: AppState, action) => {
state.status.text = action.payload;
})
.addCase(setTuneId, (state: AppState, action) => {
state.navigation.tuneId = action.payload;
});

View File

@ -22,13 +22,11 @@ export const loadTune = async (tuneData: TunesRecordFull | null) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const { fetchINIFile, fetchTuneFile } = useServerStorage();
const started = new Date();
const tuneRaw = await fetchTuneFile(tuneData.id, tuneData.tuneFile);
const tuneParser = new TuneParser().parse(tuneRaw);
if (!tuneParser.isValid()) {
console.error('Invalid tune');
notification.error({ message: 'Error', description: 'Tune file is not valid!' });
return;
@ -50,12 +48,8 @@ export const loadTune = async (tuneData: TunesRecordFull | null) => {
};
config.constants.pages[0].data.divider = divider;
const loadingTimeInfo = `Tune loaded in ${(new Date().getTime() - started.getTime())}ms`;
console.info(loadingTimeInfo);
store.dispatch({ type: 'config/load', payload: config });
store.dispatch({ type: 'tune/load', payload: tune });
store.dispatch({ type: 'status', payload: loadingTimeInfo });
} catch (error) {
iniLoadingError((error as Error));
}