diff --git a/ts/deckoptions/RevertButton.svelte b/ts/deckoptions/RevertButton.svelte index 19b092827..4ac271012 100644 --- a/ts/deckoptions/RevertButton.svelte +++ b/ts/deckoptions/RevertButton.svelte @@ -10,6 +10,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import Badge from "./Badge.svelte"; import { gearIcon, revertIcon } from "./icons"; import { isEqual as isEqualLodash, cloneDeep } from "lodash-es"; + import { touchDeviceKey } from "components/contextKeys"; + import { getContext } from "svelte"; type T = unknown; @@ -32,6 +34,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html $: modified = !isEqual(value, defaultValue); $: className = !modified ? "opacity-25" : ""; + const isTouchDevice = getContext(touchDeviceKey); + function revert(): void { value = cloneDeep(defaultValue); } @@ -53,7 +57,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html { revert(); // Otherwise the menu won't close when the item is clicked @@ -67,7 +71,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html