1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-06-01 23:44:17 +02:00
This commit is contained in:
syuilo
2025-08-26 08:57:36 +09:00
parent 506c8a259b
commit 120af977a9
8 changed files with 21 additions and 24 deletions

View File

@@ -29,7 +29,7 @@ import MkButton from '@/components/MkButton.vue';
const state = ref<'fetching' | 'done'>('fetching');
function fetch() {
function _fetch_() {
const params = new URL(window.location.href).searchParams;
// acctのほうはdeprecated
@@ -44,20 +44,18 @@ function fetch() {
if (uri.startsWith('https://')) {
promise = misskeyApi('ap/show', {
uri,
});
promise.then(res => {
}).then(res => {
if (res.type === 'User') {
mainRouter.replace('/@:acct/:page?', {
params: {
acct: res.host != null ? `${res.object.username}@${res.object.host}` : res.object.username,
}
},
});
} else if (res.type === 'Note') {
mainRouter.replace('/notes/:noteId/:initialTab?', {
params: {
noteId: res.object.id,
}
},
});
} else {
os.alert({
@@ -70,12 +68,11 @@ function fetch() {
if (uri.startsWith('acct:')) {
uri = uri.slice(5);
}
promise = misskeyApi('users/show', Misskey.acct.parse(uri));
promise.then(user => {
promise = misskeyApi('users/show', Misskey.acct.parse(uri)).then(user => {
mainRouter.replace('/@:acct/:page?', {
params: {
acct: user.host != null ? `${user.username}@${user.host}` : user.username,
}
},
});
});
}
@@ -96,7 +93,7 @@ function goToMisskey(): void {
window.location.href = '/';
}
fetch();
_fetch_();
const headerActions = computed(() => []);