fix: recommended timeline

I doubt itll work, but...

🙏

hail mairy

certified typeorm moment

im stuff

debug log

not a fan of js/ts

istg

missing parenthesis

postgres can kiss my ass

didnt need `::string[]` i think

hide caption button

Remove debug log

Clean up

no longer beta!

fix streaming
This commit is contained in:
ThatOneCalculator 2022-08-09 01:52:32 -07:00
parent cc7ddc840d
commit e7f2c7df03
6 changed files with 6 additions and 13 deletions

View File

@ -20,7 +20,6 @@
## Work in progress
- Recommended instances timeline
- OCR image captioning
- Admin custom CSS
- Improve accesibility score
@ -35,6 +34,7 @@
- Yarn 3
- Fix Dockerfile @hanna
- Saner defaults
- Recommended instances timeline
- Star as default reaction
- Recommended Instances timeline
- Rosé Pine by default (+ non-themable elements made Rosé Pine)

View File

@ -1,6 +1,6 @@
{
"name": "misskey",
"version": "12.118.1-calc.rc.4.13",
"version": "12.118.1-calc.rc.6",
"codename": "aqua",
"repository": {
"type": "git",

View File

@ -1,6 +1,6 @@
import { Brackets } from 'typeorm';
import { fetchMeta } from '@/misc/fetch-meta.js';
import { Notes, Users } from '@/models/index.js';
import { Notes } from '@/models/index.js';
import { activeUsersChart } from '@/services/chart/index.js';
import define from '../../define.js';
import { ApiError } from '../../error.js';
@ -65,16 +65,10 @@ export default define(meta, paramDef, async (ps, user) => {
}
}
// .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: instances })
//#region Construct query
const query = makePaginationQuery(Notes.createQueryBuilder('note'),
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
// Query where note.userHost is in recommended instances
.andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: m.recommendedInstances })
// .andWhere(new Brackets(qb => {
// qb.where('note.userHost IN :instances', { instances: m.recommendedInstances })
// .orWhere('note.userHost IS NULL');
// }))
.andWhere(`(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'))`)
.andWhere('(note.visibility = \'public\')')
.innerJoinAndSelect('note.user', 'user')
.leftJoinAndSelect('user.avatar', 'avatar')

View File

@ -30,7 +30,7 @@ export default class extends Channel {
// フォローしているチャンネルの投稿 の場合だけ
const meta = await fetchMeta();
if (!(
((note.user.host == null || meta.recommendedInstances.includes(note.user.host)) && note.visibility === 'public')
((note.user.host != null && meta.recommendedInstances.includes(note.user.host)) && note.visibility === 'public')
)) return;
// Ignore notes from instances the user has muted

View File

@ -12,7 +12,7 @@
<textarea id="captioninput" v-model="inputValue" autofocus :placeholder="input.placeholder" @keydown="onInputKeydown"></textarea>
<div v-if="(showOkButton || showCaptionButton || showCancelButton)" class="buttons">
<MkButton inline primary :disabled="remainingLength < 0" @click="ok">{{ $ts.ok }}</MkButton>
<MkButton inline @click="caption" >{{ $ts.caption }}</MkButton>
<!-- <MkButton inline @click="caption" >{{ $ts.caption }}</MkButton> -->
<MkButton inline @click="cancel" >{{ $ts.cancel }}</MkButton>
</div>
</div>

View File

@ -56,7 +56,6 @@
<FormSection>
<FormSwitch v-model="enableRecommendedTimeline" class="_formBlock">{{ i18n.ts.enableRecommendedTimeline }}</FormSwitch>
<template #label>{{ i18n.ts.recommendedInstances }}<span class="_beta">{{ i18n.ts.beta }}</span></template>
<FormTextarea v-model="recommendedInstances" class="_formBlock"></FormTextarea>
<template #caption>{{ i18n.ts.recommendedInstancesDescription }}</template>
</FormSection>