Fix stories

This commit is contained in:
Pranav
2024-12-12 17:36:08 -08:00
parent f865a2fb38
commit 0bba0ef6ff
2 changed files with 10 additions and 5 deletions
@@ -123,7 +123,7 @@ const props = defineProps({
},
contentAttributes: {
type: Object,
default: () => {},
default: () => { },
},
currentUserId: {
type: Number,
@@ -319,7 +319,7 @@ provideMessageContext({
>
<Avatar
:name="sender ? sender.name : ''"
:src="sender.thumbnail"
:src="sender?.thumbnail"
:size="24"
/>
</div>
@@ -1,5 +1,5 @@
<script setup>
import { computed, onMounted, nextTick } from 'vue';
import { computed, onMounted, nextTick, useTemplateRef } from 'vue';
import BaseAttachmentBubble from './BaseAttachment.vue';
import { useI18n } from 'vue-i18n';
import maplibregl from 'maplibre-gl';
@@ -55,12 +55,14 @@ const mapUrl = computed(
() => `https://maps.google.com/?q=${lat.value},${long.value}`
);
const mapContainer = useTemplateRef('mapContainer');
const setupMap = () => {
const map = new maplibregl.Map({
style: 'https://tiles.openfreemap.org/styles/positron',
center: [long.value, lat.value],
zoom: 9.5,
container: 'map',
container: mapContainer.value,
attributionControl: false,
dragPan: false,
dragRotate: false,
@@ -93,7 +95,10 @@ onMounted(async () => {
}"
>
<template #before>
<div id="map" class="z-10 w-full max-w-md -mb-12 min-w-64 h-28" />
<div
ref="mapContainer"
class="z-10 w-full max-w-md -mb-12 min-w-64 h-28"
/>
</template>
</BaseAttachmentBubble>
</template>