fix: missing transitions to useDialog
This commit is contained in:
@@ -1,15 +1,8 @@
|
||||
export const useSettings = () => {
|
||||
const open = useState<boolean>('settings:open', () => false);
|
||||
const currentPage = useState('settings-page', () => 'general');
|
||||
const pageParams = useState('settings-params', () => [] as string[]);
|
||||
|
||||
const toggle = () => {
|
||||
open.value = !open.value;
|
||||
};
|
||||
|
||||
const setPage = (id: string, params?: string | string[]) => {
|
||||
if (open.value === false) toggle();
|
||||
|
||||
currentPage.value = id;
|
||||
if (params) {
|
||||
if (typeof params === 'string') {
|
||||
@@ -21,10 +14,5 @@ export const useSettings = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const close = () => {
|
||||
open.value = false;
|
||||
currentPage.value = 'page1';
|
||||
};
|
||||
|
||||
return { open, currentPage, pageParams, toggle, setPage, close };
|
||||
return { open, currentPage, pageParams, setPage };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user