From 3bfff3509c55291eae8f59147c948de69f5a94d4 Mon Sep 17 00:00:00 2001 From: tess Date: Sun, 9 Jun 2024 03:20:32 +0200 Subject: [PATCH 1/4] fix custom emoji in welcome message --- packages/frontend/src/components/MkToast.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/components/MkToast.vue b/packages/frontend/src/components/MkToast.vue index a117e49350..494a34f62c 100644 --- a/packages/frontend/src/components/MkToast.vue +++ b/packages/frontend/src/components/MkToast.vue @@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only >
- {{ message }} +
From c8535b5d26a990206a36e26652027b9d3c99869a Mon Sep 17 00:00:00 2001 From: tess Date: Sun, 9 Jun 2024 03:34:11 +0200 Subject: [PATCH 2/4] MkToast Mfm plain prop should be static --- packages/frontend/src/components/MkToast.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/components/MkToast.vue b/packages/frontend/src/components/MkToast.vue index 494a34f62c..33170048dc 100644 --- a/packages/frontend/src/components/MkToast.vue +++ b/packages/frontend/src/components/MkToast.vue @@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only >
- +
From ce197bc2e60134f99beb6f90f528ef6a807cd425 Mon Sep 17 00:00:00 2001 From: tess Date: Sun, 9 Jun 2024 16:19:56 +0200 Subject: [PATCH 3/4] 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'); } From e7b87c026925f62e55f574d9aec42f04e8a2828a Mon Sep 17 00:00:00 2001 From: tess Date: Sun, 9 Jun 2024 16:21:12 +0200 Subject: [PATCH 4/4] Pass renderMfm as true to wrap welcome back toast in Mfm --- packages/frontend/src/boot/main-boot.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/boot/main-boot.ts b/packages/frontend/src/boot/main-boot.ts index 34612fee73..a1c74421de 100644 --- a/packages/frontend/src/boot/main-boot.ts +++ b/packages/frontend/src/boot/main-boot.ts @@ -94,7 +94,7 @@ export async function mainBoot() { }).render(); } } - } + } } catch (error) { // console.error(error); console.error('Failed to initialise the seasonal screen effect canvas context:', error); @@ -224,7 +224,7 @@ export async function mainBoot() { if (Date.now() - lastUsedDate > 1000 * 60 * 60 * 2) { toast(i18n.tsx.welcomeBackWithName({ name: $i.name || $i.username, - })); + }), true); } } miLocalStorage.setItem('lastUsed', Date.now().toString());