From ce197bc2e60134f99beb6f90f528ef6a807cd425 Mon Sep 17 00:00:00 2001 From: tess Date: Sun, 9 Jun 2024 16:19:56 +0200 Subject: [PATCH] add ability to conditionally wrap toast message in Mfm tag --- packages/frontend/src/components/MkToast.vue | 10 +++++++--- packages/frontend/src/os.ts | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/components/MkToast.vue b/packages/frontend/src/components/MkToast.vue index 33170048dc..f731b3264f 100644 --- a/packages/frontend/src/components/MkToast.vue +++ b/packages/frontend/src/components/MkToast.vue @@ -14,7 +14,8 @@ SPDX-License-Identifier: AGPL-3.0-only >
- + +
@@ -26,9 +27,12 @@ import { onMounted, ref } from 'vue'; import * as os from '@/os.js'; import { defaultStore } from '@/store.js'; -defineProps<{ +withDefaults(defineProps<{ message: string; -}>(); + renderMfm: boolean; +}>(), { + renderMfm: false, +}); const emit = defineEmits<{ (ev: 'closed'): void; diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index fc73622d6b..fd24039d95 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -211,9 +211,10 @@ export function pageWindow(path: string) { }, {}, 'closed'); } -export function toast(message: string) { +export function toast(message: string, renderMfm = false) { popup(MkToast, { message, + renderMfm, }, {}, 'closed'); }