Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
fix: user sees "add content" placeholder when not connected (#545)
Browse files Browse the repository at this point in the history
  • Loading branch information
franckwei authored Nov 12, 2024
2 parents a6b1e95 + 65808d1 commit fbdda59
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions domains/grid/components/GridView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useElementSize } from '@vueuse/core'
import { GridItem, GridLayout } from 'grid-layout-plus'
const { isMobile } = storeToRefs(useAppStore())
const { isMobile, isViewingOwnProfile } = storeToRefs(useAppStore())
const {
isEditingGrid,
tempGrid,
Expand Down Expand Up @@ -143,18 +143,21 @@ const handleItemResized = () => {
watch(
[tempGrid, isEditingGrid, selectedGridId, isMobile, viewedGrid],
() => {
const withAddContentPlaceholder =
canEditGrid.value ||
(isViewingOwnProfile.value && gridsForTabs.value.length === 1)
const updatedViewedGrid = buildGrid(
viewedGrid.value,
isMobile.value,
canEditGrid.value || gridsForTabs.value.length === 1
withAddContentPlaceholder
)
// if user is in edit mode we use temp grid, otherwise viewed grid
if (canEditGrid.value) {
const updatedTempGrid = buildGrid(
tempGrid.value,
isMobile.value,
canEditGrid.value || gridsForTabs.value.length === 1
withAddContentPlaceholder
)
gridWidgets.value = getSelectedGridWidgets(updatedTempGrid)
const changes = compareGrids(updatedViewedGrid, updatedTempGrid)
Expand Down

0 comments on commit fbdda59

Please sign in to comment.