mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 20:23:49 +01:00
Only show local posts in the timeline of top page
This commit is contained in:
parent
908c082788
commit
f23c8d93b5
@ -37,6 +37,7 @@ export default Vue.extend({
|
||||
fetch(cb?) {
|
||||
this.fetching = true;
|
||||
(this as any).api('notes', {
|
||||
local: true,
|
||||
reply: false,
|
||||
renote: false,
|
||||
media: false,
|
||||
|
@ -8,6 +8,10 @@ import Note, { pack } from '../../../models/note';
|
||||
* Get all notes
|
||||
*/
|
||||
module.exports = (params) => new Promise(async (res, rej) => {
|
||||
// Get 'local' parameter
|
||||
const [local, localErr] = $.bool.optional().get(params.local);
|
||||
if (localErr) return rej('invalid local param');
|
||||
|
||||
// Get 'reply' parameter
|
||||
const [reply, replyErr] = $.bool.optional().get(params.reply);
|
||||
if (replyErr) return rej('invalid reply param');
|
||||
@ -61,6 +65,10 @@ module.exports = (params) => new Promise(async (res, rej) => {
|
||||
};
|
||||
}
|
||||
|
||||
if (local) {
|
||||
query._user.host = null;
|
||||
}
|
||||
|
||||
if (reply != undefined) {
|
||||
query.replyId = reply ? { $exists: true, $ne: null } : null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user