feat: ✨ Ricarica i record alla chiusura di una DeleteDialog
This commit is contained in:
parent
aab28c8c56
commit
3d90a4eb41
|
@ -56,7 +56,6 @@ export default class DeleteRecordDialog<M extends Model<any, any>, A extends Del
|
||||||
// TODO: Better way for pluralization in i18n
|
// TODO: Better way for pluralization in i18n
|
||||||
void showSnackbar(this.records.length > 1 ? __('Record eliminati!') : __('Record eliminato!'));
|
void showSnackbar(this.records.length > 1 ? __('Record eliminati!') : __('Record eliminato!'));
|
||||||
this.close('deleted');
|
this.close('deleted');
|
||||||
m.redraw();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
void showSnackbar(__('Errore durante l\'eliminazione del record! :error', {error: (error as RequestError<{message: string}>).response.message}), false);
|
void showSnackbar(__('Errore durante l\'eliminazione del record! :error', {error: (error as RequestError<{message: string}>).response.message}), false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -267,6 +267,13 @@ export default abstract class RecordsPage<M extends Model<any, any>, D extends A
|
||||||
|
|
||||||
if (!state) {
|
if (!state) {
|
||||||
state = Stream<boolean>();
|
state = Stream<boolean>();
|
||||||
|
state.map((open) => {
|
||||||
|
if (!open) {
|
||||||
|
this.refreshRecords = true;
|
||||||
|
m.redraw();
|
||||||
|
}
|
||||||
|
return open;
|
||||||
|
});
|
||||||
this.deleteRecordsDialogStates.set(key, state);
|
this.deleteRecordsDialogStates.set(key, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue