wip
This commit is contained in:
parent
ca4ac0f3b3
commit
bdffbd791f
|
@ -96,7 +96,6 @@ export async function removeAccount(idOrToken: Account['id']) {
|
|||
|
||||
function fetchAccount(token: string, id?: string, forceShowDialog?: boolean): Promise<Account> {
|
||||
return new Promise((done, fail) => {
|
||||
// Fetch user
|
||||
window.fetch(`${apiUrl}/i`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
|
|
|
@ -28,6 +28,7 @@ import * as os from '@/os';
|
|||
import MkModal from '@/components/MkModal.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import { i18n } from '@/i18n';
|
||||
import { $i, updateAccount } from '@/account';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
announcement: misskey.entities.Announcement;
|
||||
|
@ -40,6 +41,9 @@ const modal = shallowRef<InstanceType<typeof MkModal>>();
|
|||
function ok() {
|
||||
modal.value.close();
|
||||
os.api('i/read-announcement', { announcementId: props.announcement.id });
|
||||
updateAccount({
|
||||
unreadAnnouncements: $i!.unreadAnnouncements.filter(a => a.id !== props.announcement.id),
|
||||
});
|
||||
}
|
||||
|
||||
function onBgClick() {
|
||||
|
|
|
@ -34,7 +34,7 @@ import MkButton from '@/components/MkButton.vue';
|
|||
import * as os from '@/os';
|
||||
import { i18n } from '@/i18n';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata';
|
||||
import { $i } from '@/account';
|
||||
import { $i, updateAccount } from '@/account';
|
||||
|
||||
const pagination = {
|
||||
endpoint: 'announcements' as const,
|
||||
|
@ -50,6 +50,9 @@ function read(id: string) {
|
|||
return announcement;
|
||||
});
|
||||
os.api('i/read-announcement', { announcementId: id });
|
||||
updateAccount({
|
||||
unreadAnnouncements: $i!.unreadAnnouncements.filter(a => a.id !== id),
|
||||
});
|
||||
}
|
||||
|
||||
const headerActions = $computed(() => []);
|
||||
|
|
Loading…
Reference in New Issue