mirror of
https://github.com/aleksilassila/reiverr.git
synced 2026-04-22 00:35:12 +02:00
Fully working sonarr integration
This commit is contained in:
@@ -10,6 +10,10 @@ function createModalStack() {
|
||||
...store,
|
||||
push: (symbol: Symbol) => {
|
||||
store.update((s) => {
|
||||
if (s.stack.includes(symbol)) {
|
||||
return s;
|
||||
}
|
||||
|
||||
s.stack.push(symbol);
|
||||
s.top = symbol;
|
||||
return s;
|
||||
@@ -26,3 +30,19 @@ function createModalStack() {
|
||||
}
|
||||
|
||||
export const modalStack = createModalStack();
|
||||
|
||||
export type ModalProps = ReturnType<typeof createModalProps>;
|
||||
|
||||
export function createModalProps(onClose: () => void) {
|
||||
const id = Symbol();
|
||||
|
||||
function close() {
|
||||
onClose(); // ORDER MATTERS HERE
|
||||
modalStack.remove(id);
|
||||
}
|
||||
|
||||
return {
|
||||
close,
|
||||
id
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user