fix: issues you catch when creating launch demo 😅
This commit is contained in:
@@ -14,7 +14,6 @@
|
|||||||
import { currentOrg } from '$lib/utils/store/org';
|
import { currentOrg } from '$lib/utils/store/org';
|
||||||
import { ChevronRight } from 'carbon-icons-svelte';
|
import { ChevronRight } from 'carbon-icons-svelte';
|
||||||
import ProfileMenu from '$lib/components/Org/ProfileMenu/index.svelte';
|
import ProfileMenu from '$lib/components/Org/ProfileMenu/index.svelte';
|
||||||
|
|
||||||
interface SideLinks {
|
interface SideLinks {
|
||||||
name: string;
|
name: string;
|
||||||
icon: any;
|
icon: any;
|
||||||
@@ -69,8 +68,6 @@
|
|||||||
}
|
}
|
||||||
].filter((link) => (link.show ? link.show() : true));
|
].filter((link) => (link.show ? link.show() : true));
|
||||||
|
|
||||||
$: console.log('sideLinks', sideLinks);
|
|
||||||
|
|
||||||
const toggleSidebar = () => {
|
const toggleSidebar = () => {
|
||||||
$sideBar.hidden = !$sideBar.hidden;
|
$sideBar.hidden = !$sideBar.hidden;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
align="right-bottom"
|
align="right-bottom"
|
||||||
caret={true}
|
caret={true}
|
||||||
on:click:outside={({ detail }) => {
|
on:click:outside={({ detail }) => {
|
||||||
console.log('on:click:outside');
|
|
||||||
$profileMenu.open = !!$profileMenu.ref?.contains(detail.target);
|
$profileMenu.open = !!$profileMenu.ref?.contains(detail.target);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
|
import debounce from 'lodash/debounce';
|
||||||
import ColorPicker from 'svelte-awesome-color-picker';
|
import ColorPicker from 'svelte-awesome-color-picker';
|
||||||
import { Grid, Row, Column } from 'carbon-components-svelte';
|
import { Grid, Row, Column } from 'carbon-components-svelte';
|
||||||
import FlashFilled from 'carbon-icons-svelte/lib/FlashFilled.svelte';
|
import FlashFilled from 'carbon-icons-svelte/lib/FlashFilled.svelte';
|
||||||
@@ -38,6 +39,19 @@
|
|||||||
default: ''
|
default: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const saveTheme = debounce(async (theme) => {
|
||||||
|
const { error, data } = await supabase
|
||||||
|
.from('organization')
|
||||||
|
.update({ theme })
|
||||||
|
.match({ id: $currentOrg.id });
|
||||||
|
|
||||||
|
console.log('Debounced update theme', data);
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
snackbar.error('Failed to update theme: ' + error.message);
|
||||||
|
}
|
||||||
|
}, 700);
|
||||||
|
|
||||||
function handleChangeTheme(t = '') {
|
function handleChangeTheme(t = '') {
|
||||||
return async () => {
|
return async () => {
|
||||||
document.body.className = document.body.className
|
document.body.className = document.body.className
|
||||||
@@ -51,12 +65,7 @@
|
|||||||
|
|
||||||
setTheme(t);
|
setTheme(t);
|
||||||
|
|
||||||
const res = await supabase
|
saveTheme(t);
|
||||||
.from('organization')
|
|
||||||
.update({ theme: t })
|
|
||||||
.match({ id: $currentOrg.id });
|
|
||||||
|
|
||||||
console.log('Update theme', res);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,14 +77,7 @@
|
|||||||
|
|
||||||
$currentOrg.theme = hex;
|
$currentOrg.theme = hex;
|
||||||
|
|
||||||
const { error } = await supabase
|
saveTheme(hex);
|
||||||
.from('organization')
|
|
||||||
.update({ theme: hex })
|
|
||||||
.match({ id: $currentOrg.id });
|
|
||||||
|
|
||||||
if (error) {
|
|
||||||
snackbar.error('Failed to update theme: ' + error.message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleUpdate() {
|
async function handleUpdate() {
|
||||||
|
|||||||
Reference in New Issue
Block a user