Fix UI, beta versioning

This commit is contained in:
ThatOneCalculator 2022-12-11 18:32:19 -08:00
parent 43a7891e4f
commit cfb5832e24
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
3 changed files with 15 additions and 13 deletions

View File

@ -1,6 +1,6 @@
{
"name": "calckey",
"version": "13.0.0-rc5",
"version": "13.0.0-beta1",
"codename": "aqua",
"repository": {
"type": "git",

View File

@ -1,14 +1,14 @@
import { In } from 'typeorm';
import { User } from '@/models/entities/user.js';
import type { User } from '@/models/entities/user.js';
import { Users, DriveFiles, Notes, Channels, Blockings } from '@/models/index.js';
import { resolveUser } from '@/remote/resolve-user.js';
import { ApiError } from '../../error.js';
import acceptAllFollowRequests from '@/services/following/requests/accept-all.js';
import { publishToFollowers } from '@/services/i/update.js';
import { apiLogger } from '../../logger.js';
import { publishMainStream, publishUserEvent } from '@/services/stream.js';
import define from '../../define.js';
import { DAY } from '@/const.js';
import { apiLogger } from '../../logger.js';
import define from '../../define.js';
import { ApiError } from '../../error.js';
export const meta = {
tags: ['users'],
@ -32,7 +32,7 @@ export const meta = {
code: 'NOT_REMOTE',
id: '4362f8dc-731f-4ad8-a694-be2a88922a24',
},
}
},
} as const;
export const paramDef = {
@ -45,15 +45,14 @@ export const paramDef = {
// eslint-disable-next-line import/no-default-export
export default define(meta, paramDef, async (ps, user) => {
if(!ps.alsoKnownAs) throw new ApiError(meta.errors.noSuchUser);
if (!ps.alsoKnownAs) throw new ApiError(meta.errors.noSuchUser);
let unfiltered: string = ps.alsoKnownAs;
if(unfiltered.startsWith('@')) unfiltered = unfiltered.substring(1);
if(!unfiltered.includes('@')) throw new ApiError(meta.errors.notRemote);
if (unfiltered.startsWith('@')) unfiltered = unfiltered.substring(1);
if (!unfiltered.includes('@')) throw new ApiError(meta.errors.notRemote);
let userAddress: string[] = unfiltered.split("@");
const userAddress: string[] = unfiltered.split('@');
const knownAs: User = await resolveUser(userAddress[0], userAddress[1]).catch(e => {
apiLogger.warn(`failed to resolve remote user: ${e}`);
@ -62,7 +61,7 @@ export default define(meta, paramDef, async (ps, user) => {
const updates = {} as Partial<User>;
if(!knownAs.uri) knownAs.uri = "";
if (!knownAs.uri) knownAs.uri = '';
updates.alsoKnownAs = [knownAs.uri];
await Users.update(user.id, updates);

View File

@ -18,7 +18,7 @@
<template #prefix><i class="ph-airplane-landing-bold ph-lg"></i></template>
<template #label>{{ i18n.ts.moveFromLabel }}</template>
</FormInput>
<FormButton class="button" inline primary @click="save(accountAlias)">
<FormButton class="button" inline primary @click="save(accountAlias.toString())">
<i class="ph-floppy-disk-back-bold ph-lg"></i> {{ i18n.ts.save }}
</FormButton>
<div class="description">{{ i18n.ts.moveFromDescription }}</div>
@ -38,6 +38,9 @@ let moveToAccount = $ref('');
let accountAlias = $ref('');
async function save(account): Promise<void> {
console.log(accountAlias);
console.log(accountAlias.toString());
console.log(account);
os.apiWithDialog('i/known-as', {
alsoKnownAs: account,
});