Skip to content

Commit a79255d

Browse files
committed
Bug fixes
1 parent 7bf83b4 commit a79255d

File tree

7 files changed

+33
-11
lines changed

7 files changed

+33
-11
lines changed

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/bundle/40-streamdeck.rules

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ SUBSYSTEM=="usb", ATTR{idVendor}=="0fd9", ATTR{idProduct}=="0086", MODE="0660",
99
SUBSYSTEM=="usb", ATTR{idVendor}=="0fd9", ATTR{idProduct}=="0084", MODE="0660", GROUP="plugdev"
1010
SUBSYSTEM=="usb", ATTR{idVendor}=="0fd9", ATTR{idProduct}=="009a", MODE="0660", GROUP="plugdev"
1111
SUBSYSTEM=="usb", ATTR{idVendor}=="5548", ATTR{idProduct}=="6674", MODE="0660", GROUP="plugdev"
12+
SUBSYSTEM=="usb", ATTR{idVendor}=="5548", ATTR{idProduct}=="6672", MODE="0660", GROUP="plugdev"
13+
SUBSYSTEM=="usb", ATTR{idVendor}=="0300", ATTR{idProduct}=="1010", MODE="0660", GROUP="plugdev"
1214

1315
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0060", MODE="0660", GROUP="plugdev"
1416
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006d", MODE="0660", GROUP="plugdev"
@@ -21,6 +23,8 @@ SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0086", MODE="0660"
2123
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0084", MODE="0660", GROUP="plugdev"
2224
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="009a", MODE="0660", GROUP="plugdev"
2325
SUBSYSTEM=="usb", ATTRS{idVendor}=="5548", ATTRS{idProduct}=="6674", MODE="0660", GROUP="plugdev"
26+
SUBSYSTEM=="usb", ATTRS{idVendor}=="5548", ATTRS{idProduct}=="6672", MODE="0660", GROUP="plugdev"
27+
SUBSYSTEM=="usb", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="1010", MODE="0660", GROUP="plugdev"
2428

2529
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="0fd9", ATTR{idProduct}=="0060", MODE="0660", GROUP="plugdev"
2630
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="0fd9", ATTR{idProduct}=="006d", MODE="0660", GROUP="plugdev"
@@ -33,6 +37,8 @@ KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="0fd9", ATTR{idProduct}=
3337
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="0fd9", ATTR{idProduct}=="0084", MODE="0660", GROUP="plugdev"
3438
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="0fd9", ATTR{idProduct}=="009a", MODE="0660", GROUP="plugdev"
3539
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="5548", ATTR{idProduct}=="6674", MODE="0660", GROUP="plugdev"
40+
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="5548", ATTR{idProduct}=="6672", MODE="0660", GROUP="plugdev"
41+
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTR{idVendor}=="0300", ATTR{idProduct}=="1010", MODE="0660", GROUP="plugdev"
3642

3743
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0060", MODE="0660", GROUP="plugdev"
3844
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006d", MODE="0660", GROUP="plugdev"
@@ -45,3 +51,5 @@ KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0fd9", ATTRS{idProduct
4551
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0084", MODE="0660", GROUP="plugdev"
4652
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="009a", MODE="0660", GROUP="plugdev"
4753
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="5548", ATTRS{idProduct}=="6674", MODE="0660", GROUP="plugdev"
54+
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="5548", ATTRS{idProduct}=="6672", MODE="0660", GROUP="plugdev"
55+
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0300", ATTRS{idProduct}=="1010", MODE="0660", GROUP="plugdev"

src-tauri/src/events/inbound/states.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ pub async fn set_title(event: ContextAndPayloadEvent<SetTitlePayload>) -> Result
4040
Ok(())
4141
}
4242

43-
pub async fn set_image(event: ContextAndPayloadEvent<SetImagePayload>) -> Result<(), anyhow::Error> {
43+
pub async fn set_image(mut event: ContextAndPayloadEvent<SetImagePayload>) -> Result<(), anyhow::Error> {
44+
if let Some(image) = &event.payload.image {
45+
if image.is_empty() {
46+
event.payload.image = None;
47+
}
48+
}
49+
4450
let mut locks = acquire_locks_mut().await;
4551

4652
if let Some(instance) = get_instance_mut(&event.context, &mut locks).await? {

src-tauri/src/store/profiles.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ impl ProfileStores {
5353
let actions = categories.values().flatten().collect::<Vec<_>>();
5454
let plugins_dir = config_dir().join("plugins");
5555
let keep_instance = |instance: &ActionInstance| -> bool {
56-
plugins_dir.join(&instance.action.plugin).exists()
57-
&& (!futures::executor::block_on(crate::plugins::is_plugin_registered(&instance.action.plugin)) || actions.iter().any(|v| v.uuid == instance.action.uuid))
56+
instance.action.plugin == "opendeck"
57+
|| (plugins_dir.join(&instance.action.plugin).exists()
58+
&& (!futures::executor::block_on(crate::plugins::is_plugin_registered(&instance.action.plugin)) || actions.iter().any(|v| v.uuid == instance.action.uuid)))
5859
};
5960
for slot in store.value.keys.iter_mut() {
6061
if let Some(instance) = slot {

src/components/DeviceSelector.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
$: {
4747
if (devices[value]) {
4848
const width = (devices[value].columns * 128) + 256;
49-
const height = (devices[value].rows * 128) + 192;
49+
const height = (devices[value].rows * 128) + 256;
5050
const window = getCurrentWindow();
5151
window.setMinSize(new LogicalSize(width, height)).then(async () => {
5252
const innerSize = await window.innerSize();

src/components/InstanceEditor.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
$: invoke("set_state", { instance, state });
2323
</script>
2424

25+
<svelte:window
26+
on:keydown={(event) => {
27+
if (event.key == "Escape") showEditor = false;
28+
}}
29+
/>
30+
2531
<div class="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 p-2 dark:text-neutral-300 bg-neutral-100 dark:bg-neutral-700 border-2 dark:border-neutral-600 rounded-lg z-10">
2632
<div class="flex flex-row">
2733
<div class="select-wrapper ml-2 mt-2 mb-1 w-full">

src/components/PluginManager.svelte

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
let showPopup: boolean;
2323
2424
async function installPlugin(id: string, name: string, url: string | null = null, file: string | null = null) {
25-
if (!file && !await ask(`Install "${name}"? It may take a while to download the plugin.`, { title: `Install "${name}"?` })) return;
25+
if (!file && !await ask(`It may take a while to download the plugin.`, { title: `Install "${name}"?` })) return;
2626
try {
2727
await invoke("install_plugin", { id, url, file });
2828
message(`Successfully installed "${name}".`, { title: `Installed "${name}"` });
2929
actionList().reload();
3030
installed = await invoke("list_plugins");
3131
} catch (error: any) {
32-
message(`Failed to install "${name}": ${error}`, { title: `Failed to install "${name}"` });
32+
message(error, { title: `Failed to install "${name}"` });
3333
}
3434
}
3535
@@ -63,7 +63,7 @@
6363
try {
6464
res = await (await fetch(endpoint)).json();
6565
} catch (error: any) {
66-
message(`Failed to install "${plugin.name}": ${error}`, { title: `Failed to install "${plugin.name}"` });
66+
message(error, { title: `Failed to install "${plugin.name}"` });
6767
return;
6868
}
6969
@@ -86,9 +86,10 @@
8686
8787
async function installPluginFile() {
8888
const path = await open({ multiple: false, directory: false });
89-
const id = path ? prompt("Plugin ID:") : null;
89+
if (!path) return;
90+
const id = prompt("Plugin ID:");
9091
if (!id || id.split(".").length < 3) {
91-
message("Failed to install plugin from file: invalid plugin ID", { title: "Failed to install" });
92+
message("Invalid plugin ID", { title: `Failed to install "${id}"` });
9293
return;
9394
}
9495
installPlugin(id, id, null, path);
@@ -103,7 +104,7 @@
103104
deviceSelector().reloadProfiles();
104105
installed = await invoke("list_plugins");
105106
} catch (error: any) {
106-
message(`Failed to remove "${plugin.name}": ${error}`, { title: `Failed to remove "${plugin.name}"` });
107+
message(error, { title: `Failed to remove "${plugin.name}"` });
107108
}
108109
}
109110

0 commit comments

Comments
 (0)