Skip to content

Commit

Permalink
Fixed QA issue
Browse files Browse the repository at this point in the history
  • Loading branch information
elsoazemelet committed Apr 22, 2024
1 parent 498b626 commit 6d0066e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 30 deletions.
38 changes: 21 additions & 17 deletions src/renderer/main/grid-layout/AddModuleButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,28 @@
</script>

<button
class=" rounded-full fill-transparent bg-transparent h-10 w-10 p-3 hover:bg-white/15 hover:fill-secondary"
class="flex h-full w-full items-center justify-center group"
on:click={handleClick}
>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 45.402 45.402"
xml:space="preserve"
><g id="SVGRepo_bgCarrier" stroke-width="0" /><g
id="SVGRepo_tracerCarrier"
stroke-linecap="round"
stroke-linejoin="round"
/><g id="SVGRepo_iconCarrier">
<g>
<path
d="M41.267,18.557H26.832V4.134C26.832,1.851,24.99,0,22.707,0c-2.283,0-4.124,1.851-4.124,4.135v14.432H4.141 c-2.283,0-4.139,1.851-4.138,4.135c-0.001,1.141,0.46,2.187,1.207,2.934c0.748,0.749,1.78,1.222,2.92,1.222h14.453V41.27 c0,1.142,0.453,2.176,1.201,2.922c0.748,0.748,1.777,1.211,2.919,1.211c2.282,0,4.129-1.851,4.129-4.133V26.857h14.435 c2.283,0,4.134-1.867,4.133-4.15C45.399,20.425,43.548,18.557,41.267,18.557z"
/>
</g>
</g></svg
<div
class="rounded-full fill-transparent bg-transparent h-10 w-10 p-3 group-hover:bg-white/15 group-hover:fill-secondary"
>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 45.402 45.402"
xml:space="preserve"
><g id="SVGRepo_bgCarrier" stroke-width="0" /><g
id="SVGRepo_tracerCarrier"
stroke-linecap="round"
stroke-linejoin="round"
/><g id="SVGRepo_iconCarrier">
<g>
<path
d="M41.267,18.557H26.832V4.134C26.832,1.851,24.99,0,22.707,0c-2.283,0-4.124,1.851-4.124,4.135v14.432H4.141 c-2.283,0-4.139,1.851-4.138,4.135c-0.001,1.141,0.46,2.187,1.207,2.934c0.748,0.749,1.78,1.222,2.92,1.222h14.453V41.27 c0,1.142,0.453,2.176,1.201,2.922c0.748,0.748,1.777,1.211,2.919,1.211c2.282,0,4.129-1.851,4.129-4.133V26.857h14.435 c2.283,0,4.134-1.867,4.133-4.15C45.399,20.425,43.548,18.557,41.267,18.557z"
/>
</g>
</g></svg
>
</div>
</button>
12 changes: 8 additions & 4 deletions src/renderer/main/grid-layout/GridLayout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,10 @@
class="relative"
>
{#if device.architecture === "virtual"}
<!-- LEFT -->
{#if typeof $devices.find((e) => e.dx === device.dx - 1 && e.dy === device.dy) === "undefined"}
<div
class="absolute left-0 top-1/2 -translate-x-full -translate-y-1/2 -ml-2"
class="absolute left-0 top-1/2 -translate-x-full -translate-y-1/2 -ml-2 h-full"
>
<AddModuleButton
on:click={() =>
Expand All @@ -233,9 +234,10 @@
</div>
{/if}
<!-- RIGHT -->
{#if typeof $devices.find((e) => e.dx === device.dx + 1 && e.dy === device.dy) === "undefined"}
<div
class="absolute right-0 top-1/2 translate-x-full -translate-y-1/2 -mr-2"
class="absolute right-0 top-1/2 translate-x-full -translate-y-1/2 -mr-2 h-full"
>
<AddModuleButton
on:click={() =>
Expand All @@ -244,9 +246,10 @@
</div>
{/if}
<!-- BOTTOM -->
{#if typeof $devices.find((e) => e.dy === device.dy - 1 && e.dx === device.dx) === "undefined"}
<div
class="absolute left-1/2 bottom-0 -translate-x-1/2 translate-y-full -mb-2"
class="absolute left-1/2 bottom-0 -translate-x-1/2 translate-y-full -mb-2 w-full"
>
<AddModuleButton
on:click={() =>
Expand All @@ -255,9 +258,10 @@
</div>
{/if}
<!-- TOP -->
{#if typeof $devices.find((e) => e.dy === device.dy + 1 && e.dx === device.dx) === "undefined"}
<div
class="absolute left-1/2 top-0 -translate-x-1/2 -translate-y-full -mt-2"
class="absolute left-1/2 top-0 -translate-x-1/2 -translate-y-full -mt-2 w-full"
>
<AddModuleButton
on:click={() =>
Expand Down
16 changes: 7 additions & 9 deletions src/renderer/runtime/engine.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,15 +275,7 @@ function createWriteBuffer() {
}

await sleep(10);
sendToGrid(current, sendImmediate)
.then(resolve)
.catch(reject)
.finally(() => {
_write_buffer.update((s) => {
s.shift();
return s;
});
});
sendToGrid(current, sendImmediate).then(resolve).catch(reject);
});
}

Expand Down Expand Up @@ -375,6 +367,12 @@ function createWriteBuffer() {
console.log("Rejected:", obj.descr.class_name);
console.log("Reason:", e);
reject(e);
})
.finally(() => {
_write_buffer.update((s) => {
s.shift();
return s;
});
});
});
}
Expand Down

0 comments on commit 6d0066e

Please sign in to comment.