Merge branch 'acct-parse-url' into lookup-api

This commit is contained in:
tamaina 2025-08-28 23:31:08 +09:00
commit 57cfbde973
7 changed files with 14 additions and 22 deletions

View File

@ -78,7 +78,7 @@ function subscribe() {
// SEE: https://developer.mozilla.org/en-US/docs/Web/API/PushManager/subscribe#Parameters // SEE: https://developer.mozilla.org/en-US/docs/Web/API/PushManager/subscribe#Parameters
return promiseDialog(registration.value.pushManager.subscribe({ return promiseDialog(registration.value.pushManager.subscribe({
userVisibleOnly: true, userVisibleOnly: true,
applicationServerKey: urlBase64ToUint8Array(instance.swPublickey), applicationServerKey: urlBase64ToBase64(instance.swPublickey),
}) })
.then(async subscription => { .then(async subscription => {
pushSubscription.value = subscription; pushSubscription.value = subscription;
@ -131,22 +131,16 @@ function encode(buffer: ArrayBuffer | null) {
} }
/** /**
* Convert the URL safe base64 string to a Uint8Array * Convert the URL safe base64 string to a base64 string
* @param base64String base64 string * @param base64String base64 string
*/ */
function urlBase64ToUint8Array(base64String: string): Uint8Array { function urlBase64ToBase64(base64String: string): string {
const padding = '='.repeat((4 - base64String.length % 4) % 4); const padding = '='.repeat((4 - base64String.length % 4) % 4);
const base64 = (base64String + padding) const base64 = (base64String + padding)
.replace(/-/g, '+') .replace(/-/g, '+')
.replace(/_/g, '/'); .replace(/_/g, '/');
const rawData = window.atob(base64); return base64;
const outputArray = new Uint8Array(rawData.length);
for (let i = 0; i < rawData.length; ++i) {
outputArray[i] = rawData.charCodeAt(i);
}
return outputArray;
} }
if (navigator.serviceWorker == null) { if (navigator.serviceWorker == null) {

View File

@ -84,7 +84,6 @@ const bound = computed(() => props.link
: {}); : {});
const url = computed(() => { const url = computed(() => {
if (props.user.avatarUrl == null) return null;
if (prefer.s.disableShowingAnimatedImages || prefer.s.dataSaver.avatar) return getStaticImageUrl(props.user.avatarUrl); if (prefer.s.disableShowingAnimatedImages || prefer.s.dataSaver.avatar) return getStaticImageUrl(props.user.avatarUrl);
return props.user.avatarUrl; return props.user.avatarUrl;
}); });

View File

@ -54,14 +54,10 @@ router.useListener('change', ({ resolved }) => {
if (resolved == null || 'redirect' in resolved.route) return; if (resolved == null || 'redirect' in resolved.route) return;
if (resolved.route.path === currentRoutePath && deepEqual(resolved.props, currentPageProps.value)) return; if (resolved.route.path === currentRoutePath && deepEqual(resolved.props, currentPageProps.value)) return;
function _() { currentPageComponent.value = resolved.route.component;
currentPageComponent.value = resolved.route.component; currentPageProps.value = resolved.props;
currentPageProps.value = resolved.props; key.value = router.getCurrentFullPath();
key.value = router.getCurrentFullPath(); currentRoutePath = resolved.route.path;
currentRoutePath = resolved.route.path;
}
_();
}); });
</script> </script>

View File

@ -78,7 +78,7 @@ const timeline = computed(() => {
return paginator.items.value.map(x => ({ return paginator.items.value.map(x => ({
id: x.id, id: x.id,
timestamp: new Date(x.createdAt).getTime(), timestamp: new Date(x.createdAt).getTime(),
data: x, data: x as Misskey.entities.ModerationLog,
})); }));
}); });

View File

@ -40,6 +40,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed } from 'vue'; import { ref, computed } from 'vue';
import * as Misskey from 'misskey-js';
import MkInput from '@/components/MkInput.vue'; import MkInput from '@/components/MkInput.vue';
import FormSection from '@/components/form/section.vue'; import FormSection from '@/components/form/section.vue';
import MkSwitch from '@/components/MkSwitch.vue'; import MkSwitch from '@/components/MkSwitch.vue';
@ -61,7 +62,7 @@ const event_reaction = ref(true);
const event_mention = ref(true); const event_mention = ref(true);
async function create(): Promise<void> { async function create(): Promise<void> {
const events: string[] = []; const events = [] as Misskey.entities.UserWebhook['on'];
if (event_follow.value) events.push('follow'); if (event_follow.value) events.push('follow');
if (event_followed.value) events.push('followed'); if (event_followed.value) events.push('followed');
if (event_note.value) events.push('note'); if (event_note.value) events.push('note');

View File

@ -469,6 +469,8 @@ export class PreferencesManager {
return local; return local;
} else if (choice === 'merge') { } else if (choice === 'merge') {
return mergedValue!; return mergedValue!;
} else { // TSを黙らすため
return undefined;
} }
} }

View File

@ -49,7 +49,7 @@ export type ModerationLog = {
id: ID; id: ID;
createdAt: DateString; createdAt: DateString;
userId: User['id']; userId: User['id'];
user: UserDetailedNotMe | null; user: UserDetailedNotMe;
} & ({ } & ({
type: 'updateServerSettings'; type: 'updateServerSettings';
info: ModerationLogPayloads['updateServerSettings']; info: ModerationLogPayloads['updateServerSettings'];