mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
Improve toast message shortcut on component deletion (#4513)
* Improve toast message shortcut * Improved user agent check Co-authored-by: Kavin Venkatachalam <50441969+kavinvenkatachalam@users.noreply.github.com> * Improved user agent check Co-authored-by: Kavin Venkatachalam <50441969+kavinvenkatachalam@users.noreply.github.com>
This commit is contained in:
parent
904c9198ed
commit
8908617563
1 changed files with 20 additions and 7 deletions
|
|
@ -578,10 +578,16 @@ class EditorComponent extends React.Component {
|
|||
const selectedComponents = this.state?.selectedComponents;
|
||||
|
||||
removeSelectedComponent(newDefinition, selectedComponents);
|
||||
|
||||
toast('Selected components deleted! (⌘Z to undo)', {
|
||||
icon: '🗑️',
|
||||
});
|
||||
const platform = navigator?.userAgentData?.platform || navigator?.platform || 'unknown';
|
||||
if (platform.toLowerCase().indexOf('mac') > -1) {
|
||||
toast('Selected components deleted! (⌘ + Z to undo)', {
|
||||
icon: '🗑️',
|
||||
});
|
||||
} else {
|
||||
toast('Selected components deleted! (ctrl + Z to undo)', {
|
||||
icon: '🗑️',
|
||||
});
|
||||
}
|
||||
this.appDefinitionChanged(newDefinition, {
|
||||
skipAutoSave: this.isVersionReleased(),
|
||||
});
|
||||
|
|
@ -613,9 +619,16 @@ class EditorComponent extends React.Component {
|
|||
});
|
||||
|
||||
delete newDefinition.components[component.id];
|
||||
toast('Component deleted! (⌘Z to undo)', {
|
||||
icon: '🗑️',
|
||||
});
|
||||
const platform = navigator?.userAgentData?.platform || navigator?.platform || 'unknown';
|
||||
if (platform.toLowerCase().indexOf('mac') > -1) {
|
||||
toast('Component deleted! (⌘ + Z to undo)', {
|
||||
icon: '🗑️',
|
||||
});
|
||||
} else {
|
||||
toast('Component deleted! (ctrl + Z to undo)', {
|
||||
icon: '🗑️',
|
||||
});
|
||||
}
|
||||
this.appDefinitionChanged(newDefinition, {
|
||||
skipAutoSave: this.isVersionReleased(),
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue