Skip to content

Commit

Permalink
Merge pull request #731 from CodeCrowCorp/dev
Browse files Browse the repository at this point in the history
Fix: empty socials crashing DrawerEditProfile
  • Loading branch information
gagansuie authored Sep 30, 2023
2 parents 1eed570 + d02584a commit 8e31f65
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/lib/components/Profile/DrawerEditProfile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
export let showDrawer: boolean
export let profile: any
let isProfileUpdated = objectMonitor($page.data.profile)
let inputFields = [...profile.urls]
let isProfileUpdated = objectMonitor($page.data.profile)
$: inputFields = profile.urls ? [...profile.urls] : []
const removeInputField = (index: number) => {
inputFields = inputFields.filter((_, i) => i !== index)
Expand Down Expand Up @@ -85,12 +84,11 @@
}, [$page.params])
$: useOueryEffect(() => {
if(isProfileUpdated($page.data.profile)){
if (isProfileUpdated($page.data.profile)) {
if (submitBtn) submitBtn.disabled = false
toggleDrawer()
}
}, [$page.data.profile])
</script>

<div class="drawer drawer-end absolute w-full z-20 top-0 right-0">
Expand Down

0 comments on commit 8e31f65

Please sign in to comment.