mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-24 21:37:21 +00:00
Move all destructive device actions to the bottom of the overflow menu (#13490)
This commit is contained in:
parent
8db1881a93
commit
88decba851
@ -303,6 +303,17 @@ export class HaConfigDevicePage extends LitElement {
|
||||
actions.push(...this._deleteButtons);
|
||||
}
|
||||
|
||||
// Move all warning actions to the end
|
||||
actions.sort((a, b) => {
|
||||
if (a.classes === "warning" && b.classes !== "warning") {
|
||||
return 1;
|
||||
}
|
||||
if (a.classes !== "warning" && b.classes === "warning") {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
const firstDeviceAction = actions.shift();
|
||||
|
||||
if (device.disabled_by) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user