Better handling of unsupported INIs, closes: #873
This commit is contained in:
parent
90b88db1c7
commit
16851ffb5e
|
@ -40,6 +40,7 @@ import standardDialogs from './data/standardDialogs';
|
|||
import help from './data/help';
|
||||
import {
|
||||
iniLoadingError,
|
||||
tuneNotFound,
|
||||
tuneParsingError,
|
||||
} from './pages/auth/notifications';
|
||||
import { divider } from './data/constants';
|
||||
|
@ -120,7 +121,9 @@ const App = ({ ui, tuneData }: { ui: UIState, tuneData: TuneDataState }) => {
|
|||
store.dispatch({ type: 'tune/load', payload: tune });
|
||||
} catch (error) {
|
||||
iniLoadingError((error as Error));
|
||||
navigate(Routes.HUB);
|
||||
navigate(generatePath(Routes.TUNE_ROOT, {
|
||||
tuneId: tuneId!,
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -149,7 +152,7 @@ const App = ({ ui, tuneData }: { ui: UIState, tuneData: TuneDataState }) => {
|
|||
|
||||
getTune(tuneId).then(async (tune) => {
|
||||
if (!tune) {
|
||||
console.warn('Tune not found');
|
||||
tuneNotFound();
|
||||
navigate(Routes.HUB);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -125,6 +125,11 @@ const iniLoadingError = (err: Error) => notification.error({
|
|||
...baseOptions,
|
||||
});
|
||||
|
||||
const tuneNotFound = () => notification.warning({
|
||||
message: 'Tune not found',
|
||||
...baseOptions,
|
||||
});
|
||||
|
||||
const tuneParsingError = () => notification.error({
|
||||
message: 'Tune file is not valid',
|
||||
...baseOptions,
|
||||
|
@ -169,6 +174,7 @@ export {
|
|||
databaseGenericError,
|
||||
copiedToClipboard,
|
||||
iniLoadingError,
|
||||
tuneNotFound,
|
||||
tuneParsingError,
|
||||
signatureNotSupportedWarning,
|
||||
downloading,
|
||||
|
|
Loading…
Reference in New Issue