Compare commits

...

7 Commits

Author SHA1 Message Date
syuilo
2f598b8fa1 10.11.0 2018-10-13 01:04:29 +09:00
syuilo
bca349fec1 Improve performance 2018-10-13 01:00:43 +09:00
syuilo
719fac6480 お気に入りを解除できるように 2018-10-13 00:54:30 +09:00
syuilo
1012b2b2c7 10.10.1 2018-10-12 21:44:39 +09:00
syuilo
5149be4b1b Fix bug 2018-10-12 21:44:04 +09:00
syuilo
d12deeb0d8 Merge pull request #2889 from syuilo/greenkeeper/@types/elasticsearch-5.0.27
Update @types/elasticsearch to the latest version 🚀
2018-10-12 20:08:14 +09:00
greenkeeper[bot]
08d7ae11d6 fix(package): update @types/elasticsearch to version 5.0.27 2018-10-11 19:58:29 +00:00
8 changed files with 49 additions and 11 deletions

View File

@@ -363,6 +363,7 @@ common/views/components/note-menu.vue:
detail: "詳細"
copy-link: "リンクをコピー"
favorite: "お気に入り"
unfavorite: "お気に入り解除"
pin: "ピン留め"
unpin: "ピン留め解除"
delete: "削除"

View File

@@ -1,8 +1,8 @@
{
"name": "misskey",
"author": "syuilo <i@syuilo.com>",
"version": "10.10.0",
"clientVersion": "1.0.10466",
"version": "10.11.0",
"clientVersion": "1.0.10473",
"codename": "nighthike",
"main": "./built/index.js",
"private": true,
@@ -32,7 +32,7 @@
"@types/debug": "0.0.31",
"@types/deep-equal": "1.0.1",
"@types/double-ended-queue": "2.1.0",
"@types/elasticsearch": "5.0.26",
"@types/elasticsearch": "5.0.27",
"@types/file-type": "5.2.1",
"@types/gulp": "3.8.36",
"@types/gulp-htmlmin": "1.3.32",

View File

@@ -22,11 +22,21 @@ export default Vue.extend({
icon: '%fa:link%',
text: '%i18n:@copy-link%',
action: this.copyLink
}, null, {
icon: '%fa:star%',
text: '%i18n:@favorite%',
action: this.favorite
}];
}, null];
if (this.note.isFavorited) {
items.push({
icon: '%fa:star%',
text: '%i18n:@unfavorite%',
action: this.unfavorite
});
} else {
items.push({
icon: '%fa:star%',
text: '%i18n:@favorite%',
action: this.favorite
});
}
if (this.note.userId == this.$store.state.i.id) {
if ((this.$store.state.i.pinnedNoteIds || []).includes(this.note.id)) {
@@ -45,6 +55,7 @@ export default Vue.extend({
}
if (this.note.userId == this.$store.state.i.id || this.$store.state.i.isAdmin) {
items.push(null);
items.push({
icon: '%fa:trash-alt R%',
text: '%i18n:@delete%',
@@ -110,6 +121,15 @@ export default Vue.extend({
});
},
unfavorite() {
(this as any).api('notes/favorites/delete', {
noteId: this.note.id
}).then(() => {
(this as any).os.new(Ok);
this.destroyDom();
});
},
closed() {
this.$nextTick(() => {
this.destroyDom();

View File

@@ -41,7 +41,7 @@
<a class="location" v-if="appearNote.geo" :href="`https://maps.google.com/maps?q=${appearNote.geo.coordinates[1]},${appearNote.geo.coordinates[0]}`" target="_blank">%fa:map-marker-alt% %i18n:@location%</a>
<div class="renote" v-if="appearNote.renote"><mk-note-preview :note="appearNote.renote"/></div>
</div>
<span class="app" v-if="appearNote.app">via <b>{{ appearNote.apappearNote.name }}</b></span>
<span class="app" v-if="appearNote.app">via <b>{{ appearNote.app.name }}</b></span>
</div>
<footer v-if="appearNote.deletedAt == null">
<mk-reactions-viewer :note="appearNote" ref="reactionsViewer"/>

View File

@@ -11,6 +11,7 @@ import DriveFileThumbnail, { deleteDriveFileThumbnail } from './drive-file-thumb
const DriveFile = monkDb.get<IDriveFile>('driveFiles.files');
DriveFile.createIndex('md5');
DriveFile.createIndex('metadata.uri');
DriveFile.createIndex('metadata.userId');
export default DriveFile;
export const DriveFileChunk = monkDb.get('driveFiles.chunks');

View File

@@ -4,6 +4,7 @@ import db from '../db/mongodb';
import DriveFile from './drive-file';
const DriveFolder = db.get<IDriveFolder>('driveFolders');
DriveFolder.createIndex('userId');
export default DriveFolder;
export type IDriveFolder = {

View File

@@ -75,7 +75,9 @@ export const pack = (
delete _favorite._id;
// Populate note
_favorite.note = await packNote(_favorite.noteId, me);
_favorite.note = await packNote(_favorite.noteId, me, {
detail: true
});
// (データベースの不具合などで)投稿が見つからなかったら
if (_favorite.note == null) {

View File

@@ -358,8 +358,8 @@ export const pack = async (
})(_note.poll);
}
// Fetch my reaction
if (meId) {
// Fetch my reaction
_note.myReaction = (async () => {
const reaction = await Reaction
.findOne({
@@ -374,6 +374,19 @@ export const pack = async (
return null;
})();
// isFavorited
_note.isFavorited = (async () => {
const favorite = await Favorite
.count({
userId: meId,
noteId: id
}, {
limit: 1
});
return favorite === 1;
})();
}
}