-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhance: 通知の履歴をリセットできるように #13335
Merged
Merged
enhance: 通知の履歴をリセットできるように #13335
Changes from 4 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b7ee291
enhance: 通知の履歴をリセットできるように
kakkokari-gtyih cb65452
Update Changelog
kakkokari-gtyih a066764
通知欄も連動して更新するように
kakkokari-gtyih 783cb5a
Merge branch 'develop' into enh-13317
kakkokari-gtyih c93a87b
revert some changes
kakkokari-gtyih cbc40af
Merge branch 'enh-13317' of https://github.com/kakkokari-gtyih/misske…
kakkokari-gtyih f141887
Merge branch 'develop' into enh-13317
kakkokari-gtyih 9b28e7a
Merge branch 'develop' into enh-13317
kakkokari-gtyih 6630f8b
Update CHANGELOG.md
kakkokari-gtyih 1324843
Remove unused part
kakkokari-gtyih 0ded496
fix
kakkokari-gtyih 44293f7
Merge branch 'enh-13317' of https://github.com/kakkokari-gtyih/misske…
kakkokari-gtyih aea78d6
Merge branch 'develop' into enh-13317
kakkokari-gtyih e8b3736
Merge branch 'develop' into enh-13317
kakkokari-gtyih 416f0cc
Merge branch 'develop' into enh-13317
kakkokari-gtyih dd9a114
Merge branch 'develop' into enh-13317
kakkokari-gtyih File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
packages/backend/src/server/api/endpoints/notifications/flush.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* SPDX-FileCopyrightText: syuilo and misskey-project | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
*/ | ||
|
||
import { Injectable } from '@nestjs/common'; | ||
import { Endpoint } from '@/server/api/endpoint-base.js'; | ||
import { NotificationService } from '@/core/NotificationService.js'; | ||
|
||
export const meta = { | ||
tags: ['notifications', 'account'], | ||
|
||
requireCredential: true, | ||
|
||
kind: 'write:notifications', | ||
} as const; | ||
|
||
export const paramDef = { | ||
type: 'object', | ||
properties: {}, | ||
required: [], | ||
} as const; | ||
|
||
@Injectable() | ||
export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export | ||
constructor( | ||
private notificationService: NotificationService, | ||
) { | ||
super(meta, paramDef, async (ps, me) => { | ||
this.notificationService.flushAllNotifications(me.id); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ import { notificationTypes } from '@/const.js'; | |
import { infoImageUrl } from '@/instance.js'; | ||
import { defaultStore } from '@/store.js'; | ||
import MkPullToRefresh from '@/components/MkPullToRefresh.vue'; | ||
import * as Misskey from 'misskey-js'; | ||
|
||
const props = defineProps<{ | ||
excludeTypes?: typeof notificationTypes[number][]; | ||
|
@@ -75,17 +76,19 @@ function reload() { | |
}); | ||
} | ||
|
||
let connection; | ||
let connection: Misskey.ChannelConnection<Misskey.Channels['main']>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍🏻 |
||
|
||
onMounted(() => { | ||
connection = useStream().useChannel('main'); | ||
connection.on('notification', onNotification); | ||
connection.on('notificationFlushed', reload); | ||
}); | ||
|
||
onActivated(() => { | ||
pagingComponent.value?.reload(); | ||
connection = useStream().useChannel('main'); | ||
connection.on('notification', onNotification); | ||
connection.on('notificationFlushed', reload); | ||
}); | ||
|
||
onUnmounted(() => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
notifications_flushのexportを忘れてそう
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これでいいかしら(testNotificationもexport出来てなかったっぽいのでやった)