mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-21 17:32:41 +00:00
fix: undo/redo prevents use of unknown actions
This commit is contained in:
27
flake.nix
27
flake.nix
@@ -4,15 +4,19 @@
|
|||||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
};
|
};
|
||||||
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
|
outputs = {
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
self,
|
||||||
let
|
nixpkgs,
|
||||||
overlays = [ (import rust-overlay) ];
|
flake-utils,
|
||||||
pkgs = import nixpkgs { inherit system overlays; };
|
rust-overlay,
|
||||||
|
}:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system: let
|
||||||
|
overlays = [(import rust-overlay)];
|
||||||
|
pkgs = import nixpkgs {inherit system overlays;};
|
||||||
rust-bin = pkgs.rust-bin.stable.latest.default.override {
|
rust-bin = pkgs.rust-bin.stable.latest.default.override {
|
||||||
extensions = [ "rust-src" "rust-std" "clippy" "rust-analyzer" ];
|
extensions = ["rust-src" "rust-std" "clippy" "rust-analyzer"];
|
||||||
};
|
};
|
||||||
fontMin = (pkgs.python311.withPackages(ps: with ps; [ brotli fonttools ] ++ (with fonttools.optional-dependencies; [ woff ])));
|
fontMin = pkgs.python311.withPackages (ps: with ps; [brotli fonttools] ++ (with fonttools.optional-dependencies; [woff]));
|
||||||
tauriPkgs = nixpkgs.legacyPackages.${system};
|
tauriPkgs = nixpkgs.legacyPackages.${system};
|
||||||
libraries = with tauriPkgs; [
|
libraries = with tauriPkgs; [
|
||||||
webkitgtk
|
webkitgtk
|
||||||
@@ -24,11 +28,13 @@
|
|||||||
openssl_3
|
openssl_3
|
||||||
librsvg
|
librsvg
|
||||||
];
|
];
|
||||||
packages = (with pkgs; [
|
packages =
|
||||||
|
(with pkgs; [
|
||||||
nodejs_18
|
nodejs_18
|
||||||
rust-bin
|
rust-bin
|
||||||
fontMin
|
fontMin
|
||||||
]) ++ (with tauriPkgs; [
|
])
|
||||||
|
++ (with tauriPkgs; [
|
||||||
curl
|
curl
|
||||||
wget
|
wget
|
||||||
pkg-config
|
pkg-config
|
||||||
@@ -42,8 +48,7 @@
|
|||||||
# serial plugin
|
# serial plugin
|
||||||
udev
|
udev
|
||||||
]);
|
]);
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
devShell = pkgs.mkShell {
|
devShell = pkgs.mkShell {
|
||||||
buildInputs = packages;
|
buildInputs = packages;
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ export const chords = derived([overlay, deviceChords], ([overlay, chords]) => {
|
|||||||
return {
|
return {
|
||||||
id: chord.actions,
|
id: chord.actions,
|
||||||
// use the old phrase for stable editing
|
// use the old phrase for stable editing
|
||||||
sortBy: chord.phrase.map(it => KEYMAP_CODES[it].id || it).join(),
|
sortBy: chord.phrase.map(it => KEYMAP_CODES[it]?.id ?? it).join(),
|
||||||
actions: changedChord.actions,
|
actions: changedChord.actions,
|
||||||
phrase: changedChord.phrase,
|
phrase: changedChord.phrase,
|
||||||
actionsChanged: id !== JSON.stringify(changedChord.actions),
|
actionsChanged: id !== JSON.stringify(changedChord.actions),
|
||||||
@@ -110,7 +110,7 @@ export const chords = derived([overlay, deviceChords], ([overlay, chords]) => {
|
|||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
id: chord.actions,
|
id: chord.actions,
|
||||||
sortBy: chord.phrase.map(it => KEYMAP_CODES[it].id || it).join(),
|
sortBy: chord.phrase.map(it => KEYMAP_CODES[it]?.id ?? it).join(),
|
||||||
actions: chord.actions,
|
actions: chord.actions,
|
||||||
phrase: chord.phrase,
|
phrase: chord.phrase,
|
||||||
phraseChanged: false,
|
phraseChanged: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user