Browse Source

feat: show a better emoji-confirmation message, hide all emoji stuff from unregistered on items without emojis

pull/209/head
Trent Larson 3 days ago
parent
commit
499fbd2cb3
  1. 20
      src/components/ActivityListItem.vue
  2. 4
      src/services/platforms/WebPlatformService.ts

20
src/components/ActivityListItem.vue

@ -79,6 +79,7 @@
<!-- Emoji Section --> <!-- Emoji Section -->
<div <div
v-if="hasEmojis || isRegistered"
class="float-right ml-3 mb-1 bg-white rounded border border-slate-300 px-1.5 py-0.5 max-w-[240px]" class="float-right ml-3 mb-1 bg-white rounded border border-slate-300 px-1.5 py-0.5 max-w-[240px]"
> >
<div class="flex items-center justify-between gap-1"> <div class="flex items-center justify-between gap-1">
@ -503,11 +504,20 @@ export default class ActivityListItem extends Vue {
); );
if (userHasEmoji) { if (userHasEmoji) {
// User already has this emoji, ask for confirmation to remove
const confirmed = confirm(`Do you want to remove your ${emoji} emoji?`); this.$notify(
if (confirmed) { {
await this.removeEmoji(emoji); group: "modal",
} type: "confirm",
title: "Remove Emoji",
text: `Do you want to remove your ${emoji} ?`,
yesText: "Remove",
onYes: async () => {
await this.removeEmoji(emoji);
},
},
TIMEOUTS.MODAL,
);
} else { } else {
// User doesn't have this emoji, add it // User doesn't have this emoji, add it
await this.submitEmoji(emoji); await this.submitEmoji(emoji);

4
src/services/platforms/WebPlatformService.ts

@ -52,7 +52,9 @@ export class WebPlatformService implements PlatformService {
// Only initialize SharedArrayBuffer setup for web platforms // Only initialize SharedArrayBuffer setup for web platforms
if (this.isWorker()) { if (this.isWorker()) {
logger.debug("[WebPlatformService] Skipping initBackend call in worker context"); logger.debug(
"[WebPlatformService] Skipping initBackend call in worker context",
);
return; return;
} }

Loading…
Cancel
Save