Refactoring layoutManagerActionStore. It now supports an uuid field.
layoutManagerVisibilityStore is now a derived field from layoutManagerActionStore.
This commit is contained in:
parent
92fee33b64
commit
87e4367455
4 changed files with 42 additions and 53 deletions
|
@ -1,26 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { layoutManagerActionStore } from "../../Stores/LayoutManagerStore";
|
||||
import { onDestroy, onMount } from "svelte";
|
||||
import { get } from "svelte/store";
|
||||
|
||||
onMount(() => {
|
||||
for (const action of get(layoutManagerActionStore)) {
|
||||
action.userInputManager?.addSpaceEventListner(action.callback);
|
||||
if ( action.type === 'warning') {
|
||||
//remove it after 10 sec
|
||||
setTimeout(() => {
|
||||
layoutManagerActionStore.removeAction(action);
|
||||
}, 10000)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
onDestroy(() => {
|
||||
for (const action of get(layoutManagerActionStore)) {
|
||||
action.userInputManager?.removeSpaceEventListner(action.callback);
|
||||
}
|
||||
layoutManagerActionStore.clearActions();
|
||||
})
|
||||
|
||||
function onClick(callback: () => void) {
|
||||
callback();
|
||||
|
@ -75,4 +54,4 @@
|
|||
50% {bottom: 30px;}
|
||||
100% {bottom: 40px;}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue