This commit is contained in:
mattyatea 2024-01-06 20:07:23 +09:00
parent 14fb95c798
commit 68aab48f4e
6 changed files with 71 additions and 72 deletions

View File

@ -81,7 +81,7 @@ function del() {
text: i18n.t('deleteAreYouSure', { x: props.avatarDecoration?.name }),
}).then(({ canceled }) => {
if (canceled) return;
os.api('admin/avatar-decorations/delete', { id: props.avatarDecoration?.id }).then(() => {
misskeyApi('admin/avatar-decorations/delete', { id: props.avatarDecoration?.id }).then(() => {
});
});

View File

@ -693,7 +693,7 @@ async function isSensitive(Files, isSensitive: boolean) {
if (canceled) return;
Files.forEach((file) => {
os.api('drive/files/update', {
misskeyApi('drive/files/update', {
fileId: file.id,
isSensitive,
});
@ -708,7 +708,7 @@ async function fileDelete(Files) {
if (canceled) return;
Files.forEach((file) => {
os.api('drive/files/delete', {
misskeyApi('drive/files/delete', {
fileId: file.id,
});
});

View File

@ -3,23 +3,23 @@ SPDX-FileCopyrightText: syuilo and other misskey contributors
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<button
class="_button"
:class="[$style.root,{[$style.gamingDark]: gaming === 'dark',[$style.gamingLight]: gaming === 'light'
,}]" v-if="isFollowing"
<button
v-if="isFollowing"
class="_button" :class="[$style.root,{[$style.gamingDark]: gaming === 'dark',[$style.gamingLight]: gaming === 'light'
,}]"
@click="onClick"
>
>
<span v-if="props.user.notify === 'none'" :class="[{[$style.gamingDark]: gaming === 'dark',[$style.gamingLight]: gaming === 'light' }] "><i class="ti ti-bell"></i></span>
<span v-else-if="props.user.notify === 'normal'" :class="[{[$style.gamingDark]: gaming === 'dark',[$style.gamingLight]: gaming === 'light' }]"><i class="ti ti-bell-off"></i></span>
</button>
</button>
</template>
<script lang="ts" setup>
import {computed, onBeforeUnmount, onMounted, ref, watch} from 'vue';
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import * as Misskey from 'misskey-js';
import * as os from '@/os.js';
import {useStream} from '@/stream.js';
import {defaultStore} from "@/store.js";
import { useStream } from '@/stream.js';
import { defaultStore } from '@/store.js';
let gaming = ref('');
@ -41,7 +41,7 @@ watch(darkMode, () => {
} else {
gaming.value = '';
}
})
});
watch(gamingMode, () => {
if (darkMode.value && gamingMode.value == true) {
@ -51,7 +51,7 @@ watch(gamingMode, () => {
} else {
gaming.value = '';
}
})
});
const props = withDefaults(defineProps<{
user: Misskey.entities.UserDetailed,
@ -67,13 +67,13 @@ let notify = ref(props.user.notify);
const connection = useStream().useChannel('main');
if (props.user.isFollowing == null) {
os.api('users/show', {
misskeyApi('users/show', {
userId: props.user.id,
}).then(onFollowChange);
}
if (props.user.notify == null) {
os.api('users/show', {
misskeyApi('users/show', {
userId: props.user.id,
}).then(onNotifyChange);
}
@ -83,12 +83,14 @@ function onFollowChange(user: Misskey.entities.UserDetailed) {
isFollowing.value = user.isFollowing;
}
}
function onNotifyChange(user: Misskey.entities.UserDetailed) {
if (user.id === props.user.id) {
notify.value = user.notify;
console.log(props.user.notify)
console.log(props.user.notify);
}
}
async function onClick() {
try {
await os.apiWithDialog('following/update', {
@ -97,7 +99,7 @@ async function onClick() {
}).then(() => {
props.user.notify = props.user.notify === 'normal' ? 'none' : 'normal';
});
}finally {
} finally {
}
}
@ -278,10 +280,8 @@ onBeforeUnmount(() => {
}
}
.gamingDark {
color: black;
@ -292,7 +292,6 @@ onBeforeUnmount(() => {
}
@-webkit-keyframes AnimationLight {
0% {
background-position: 0% 50%

View File

@ -101,7 +101,7 @@ import { definePageMetadata } from '@/scripts/page-metadata';
const stats = ref<any>({});
onMounted(() => {
os.api('i/stats', {
misskeyApi('i/stats', {
userId: $i!.id,
}).then(response => {
stats.value = response;

View File

@ -79,11 +79,11 @@ const sendReadMessage = computed(() => pushRegistrationInServer.value?.sendReadM
const userLists = await misskeyApi('users/lists/list');
async function readAllUnreadNotes() {
await os.api('i/read-all-unread-notes');
await misskeyApi('i/read-all-unread-notes');
}
async function readAllNotifications() {
await os.api('notifications/mark-all-as-read');
await misskeyApi('notifications/mark-all-as-read');
}
async function updateReceiveConfig(type, value) {

View File

@ -82,14 +82,14 @@ async function MultideleteFile(files: Misskey.entities.DriveFile[] | null) {
if (canceled) return;
files.forEach((e)=>{
os.api('drive/files/delete', {
misskeyApi('drive/files/delete', {
fileId: e.id,
});
})
}
function isSensitive(files: Misskey.entities.DriveFile[] | null ,sensitive:boolean) {
files.forEach((e)=>{
os.api('drive/files/update', {
misskeyApi('drive/files/update', {
fileId: e.id,
isSensitive: sensitive,
}).catch(err => {