Merge pull request #369 from laoxong/develop

into master
This commit is contained in:
老兄 2024-09-30 12:28:05 +08:00 committed by GitHub
commit 10e166ca6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 40 additions and 7 deletions

View File

@ -7,7 +7,7 @@ on:
workflow_dispatch:
env:
REGISTRY_IMAGE: misskey/misskey
REGISTRY_IMAGE: laoxong/misskey
jobs:
# see https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners
@ -20,7 +20,7 @@ jobs:
platform:
- linux/amd64
- linux/arm64
if: github.repository == 'misskey-dev/misskey'
if: github.repository == 'laoxong/misskey'
steps:
- name: Prepare
run: |

View File

@ -25,7 +25,7 @@ jobs:
matrix:
platform:
- linux/amd64
- linux/arm64
# - linux/arm64
steps:
- name: Prepare
run: |

View File

@ -19,7 +19,7 @@ jobs:
env:
NODE_OPTIONS: "--max_old_space_size=7168"
if: github.repository == 'misskey-dev/misskey'
steps:
- uses: actions/checkout@v4.1.1
if: github.event_name != 'pull_request_target'

2
.gitignore vendored
View File

@ -78,3 +78,5 @@ vite.config.ts.timestamp-*
# VSCode addon
.favorites.json
/dump.rdb

View File

@ -1,3 +1,15 @@
## Unreleased
### General
-
### Client
-
### Server
-
## 2024.9.0
### General

View File

@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<MkPullToRefresh :refresher="() => reload()">
<MkPagination ref="pagingComponent" :pagination="pagination">
<MkPagination ref="pagingComponent" :pagination="pagination" @queue="onQueue">
<template #empty>
<div class="_fullinfo">
<img :src="infoImageUrl" class="_ghost"/>
@ -36,6 +36,7 @@ import { infoImageUrl } from '@/instance.js';
import { defaultStore } from '@/store.js';
import MkPullToRefresh from '@/components/MkPullToRefresh.vue';
import * as Misskey from 'misskey-js';
import { misskeyApi } from '@/scripts/misskey-api';
const props = defineProps<{
excludeTypes?: typeof notificationTypes[number][];
@ -65,9 +66,26 @@ function onNotification(notification) {
if (!isMuted) {
pagingComponent.value?.prepend(notification);
onQueue();
}
}
let queued = false;
function checkAllNotificationsCanRead() {
queued = false;
if (!document.hasFocus()) { onQueue(); return; }
if (!(pagingComponent.value?.queue.size) && !(props.excludeTypes?.length)) {
misskeyApi('notifications/mark-all-as-read');
}
}
function onQueue() {
if (queued) return;
queued = true;
setTimeout(() => checkAllNotificationsCanRead(), 2000);
}
function reload() {
return new Promise<void>((res) => {
pagingComponent.value?.reload().then(() => {

View File

@ -173,6 +173,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<MkSelect v-model="serverDisconnectedBehavior">
<template #label>{{ i18n.ts.whenServerDisconnected }}</template>
<option :value="null">什么都不做</option>
<option value="reload">{{ i18n.ts._serverDisconnectedBehavior.reload }}</option>
<option value="dialog">{{ i18n.ts._serverDisconnectedBehavior.dialog }}</option>
<option value="quiet">{{ i18n.ts._serverDisconnectedBehavior.quiet }}</option>

View File

@ -206,7 +206,7 @@ export const defaultStore = markRaw(new Storage('base', {
},
serverDisconnectedBehavior: {
where: 'device',
default: 'quiet' as 'quiet' | 'reload' | 'dialog',
default: null as null | 'quiet' | 'reload' | 'dialog',
},
nsfw: {
where: 'device',