Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.
PHP ai-agentsblueskyfacebookinstagramlaravellinkedinmastodonmcpmcp-serveropen-sourcerest-apiself-hostedsocial-mediasocial-media-managementsocial-media-schedulerthreadstiktokvuejsxyoutube
fix(tiktok): auto-switch content_type when attached media changes
Paulo Castellano28e368796a62
diff --git a/resources/js/pages/posts/Edit.vue b/resources/js/pages/posts/Edit.vueindex 80dbe4c23..c83c60893 100644--- a/resources/js/pages/posts/Edit.vue+++ b/resources/js/pages/posts/Edit.vue@@ -392,6 +392,28 @@ const triggerAutosave = () => {}};+// Auto-switch TikTok content_type to match the attached media. Without this,+// a fresh post defaults TikTok to tiktok_video, so attaching images first+// disables the TikTok tile (compliance check rejects images for video posts).+// User can still override via the variant picker in TikTokSettings.+watch(media, () => {+ if (media.value.length === 0) return;++ const first = media.value[0];+ const isVideo = first.type === 'video' || first.mime_type?.startsWith('video/');+ const isImage = first.type === 'image' || first.mime_type?.startsWith('image/');+ const target = isVideo ? 'tiktok_video' : isImage ? 'tiktok_photo' : null;+ if (!target) return;++ for (const pp of post.value.post_platforms) {+ if (pp.platform !== Platform.TikTok) continue;+ const current = platformContentTypes.value[pp.id];+ if (current && current !== target && (current === 'tiktok_video' || current === 'tiktok_photo')) {+ platformContentTypes.value = { ...platformContentTypes.value, [pp.id]: target };+ }+ }+}, { deep: true });+watch([content, media, selectedPlatformIds, scheduledDateTime, selectedLabelIds, platformMeta, platformContentTypes], triggerAutosave, { deep: true });onUnmounted(() => {