chore: changes for 1.1.2

This commit is contained in:
Andrei O 2023-10-01 06:46:14 +03:00
parent 999573a9e5
commit b1122d2cdf
No known key found for this signature in database
GPG Key ID: B961E5B68389457E
5 changed files with 22 additions and 22 deletions

View File

@ -1,5 +1,10 @@
# Change Log
## [Version 1.1.2]
- changed service worker open notification to use app.yup.io
- fixed follow notification with multiple senders
## [Version 1.1.1]
- changed auth condition

View File

@ -1,7 +1,7 @@
{
"name": "yup live",
"description": "Light alternative extension for yup protocol",
"version": "1.1.1",
"description": "Light extension helper for yup social platform.",
"version": "1.1.2",
"manifest_version": 3,
"icons": {
"16": "src/assets/icons/yup_ext_16.png",

View File

@ -161,7 +161,7 @@ const alarmHandler = async () => {
const lastFollowNotif = await getSetting('lastfollowNotif') as number
const isNew = !lastFollowNotif || ( !closeTo(new Date(lastFollowNotif), new Date(followNotif.createdAt), 2e4))
if (followNotif && isNew) {
notificationUrl = followNotif?.senders?.[0]._id ? `${API_BASE}/account/${followNotif?.senders?.[0]._id}`: undefined
notificationUrl = followNotif?.senders?.[0]._id ? `${YUP_APP_BASE}/account/${followNotif?.senders?.[0]._id}`: undefined
await chrome.notifications.create({
type: 'basic',
iconUrl: chrome.runtime.getURL('src/assets/icons/yup_ext_128.png'),
@ -176,7 +176,7 @@ const alarmHandler = async () => {
const lastCommentNotif = await getSetting('lastCommentNotif') as number
const isNew = !lastCommentNotif || ( !closeTo(new Date(lastCommentNotif), new Date(commentNotif.createdAt), 2e4))
if (commentNotif && isNew) {
notificationUrl = commentNotif?.meta?.postid ? `${API_BASE}/post/${commentNotif?.meta?.postid}`: undefined
notificationUrl = commentNotif?.meta?.postid ? `${YUP_APP_BASE}/post/${commentNotif?.meta?.postid}`: undefined
await chrome.notifications.create({
type: 'basic',
iconUrl: chrome.runtime.getURL('src/assets/icons/yup_ext_128.png'),
@ -191,7 +191,7 @@ const alarmHandler = async () => {
const lastMentionNotif = await getSetting('lastMentionNotif') as number
const isNew = !lastMentionNotif || ( !closeTo(new Date(lastMentionNotif), new Date(mentionNotif.createdAt), 2e4))
if (mentionNotif && isNew) {
notificationUrl = mentionNotif?.meta?.postid ? `${API_BASE}/post/${mentionNotif?.meta?.postid}`: undefined
notificationUrl = mentionNotif?.meta?.postid ? `${YUP_APP_BASE}/post/${mentionNotif?.meta?.postid}`: undefined
await chrome.notifications.create({
type: 'basic',
iconUrl: chrome.runtime.getURL('src/assets/icons/yup_ext_128.png'),

View File

@ -3,9 +3,8 @@
export let source
export let loading = true
export let loaded = false
export let error = false
let loading = true
let loaded = false
export const onLoad = () => {
loading = false
@ -14,18 +13,14 @@
export const onError = () => {
loading = false
error = true
source = undefined
}
$: {
if(isUrlInvalid(source)) {
loading = false
error = true
source = undefined
} else {
loading = true
error = false
}
}
</script>
@ -34,7 +29,7 @@
{#if loading || loaded}
<slot name="img">
</slot>
{:else if error}
{:else if source === undefined}
<slot name="error">
</slot>
{/if}

View File

@ -9,9 +9,10 @@
import { YUP_APP_BASE } from "@/constants/config";
let loader;
export let notif: Notification;
const numImages = notif?.senders?.length ?? 0;
let loaders: ImgLoader[] = Array(numImages).fill(null);
</script>
{#if notif.eventType === "vote"}
@ -71,14 +72,13 @@
</div>
{:else if ["follow"].includes(notif.eventType)}
<div class="flex flex-col notifBody">
{#each notif.senders as sender}
{#each notif.senders as sender, i}
<div class="flex flex-row items-center">
<ImgLoader bind:this={loader} source="{sender?.avatar}" loaded={loader?.loaded ?? false} error={loader?.error ?? false} loading={loader?.loading ?? true}>
<ImgLoader bind:this={loaders[i]} source="{sender?.avatar}" >
<img
class="notificationImage"
on:load={() => { loader.loaded = true; loader.loading = false; }}
on:error={() => { loader.error = true; loader.loading = false; }}
on:load={() => loaders[i]?.onLoad()}
on:error={() => loaders[i]?.onError()}
style={$mainStore.settings.theme === "light" ? "filter: invert(0.9);" : ""}
slot="img"
src={sender.avatar}