From 87db63d242266b8a0b39f36160e2ad5be737da88 Mon Sep 17 00:00:00 2001 From: xps2 <9610872+xps2@users.noreply.github.com> Date: Sun, 26 Aug 2018 10:11:47 +0900 Subject: [PATCH 1/6] =?UTF-8?q?donation=E3=80=81config=E3=81=AEmaintainer?= =?UTF-8?q?=E3=82=92=E5=8F=82=E7=85=A7=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/app/common/views/widgets/donation.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/client/app/common/views/widgets/donation.vue b/src/client/app/common/views/widgets/donation.vue index 470576d5e..4bc71b2b7 100644 --- a/src/client/app/common/views/widgets/donation.vue +++ b/src/client/app/common/views/widgets/donation.vue @@ -4,7 +4,7 @@

%fa:heart%%i18n:@title%

{{ '%i18n:@text%'.substr(0, '%i18n:@text%'.indexOf('{')) }} - @syuilo + @{{ meta.maintainer.name }} {{ '%i18n:@text%'.substr('%i18n:@text%'.indexOf('}') + 1) }}

@@ -15,6 +15,17 @@ import define from '../../../common/define-widget'; export default define({ name: 'donation' +}).extend({ + data() { + return { + meta: null; + }; + }, + created() { + (this as any).os.getMeta().then(meta => { + this.meta = meta; + }); + } }); From b9214cff3915c7ae1d20f021118785449f774542 Mon Sep 17 00:00:00 2001 From: xps2 <9610872+xps2@users.noreply.github.com> Date: Sun, 26 Aug 2018 10:29:24 +0900 Subject: [PATCH 2/6] fix --- src/client/app/common/views/widgets/donation.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/app/common/views/widgets/donation.vue b/src/client/app/common/views/widgets/donation.vue index 4bc71b2b7..b1352e803 100644 --- a/src/client/app/common/views/widgets/donation.vue +++ b/src/client/app/common/views/widgets/donation.vue @@ -4,7 +4,7 @@

%fa:heart%%i18n:@title%

{{ '%i18n:@text%'.substr(0, '%i18n:@text%'.indexOf('{')) }} - @{{ meta.maintainer.name }} + {{ meta.maintainer.name }} {{ '%i18n:@text%'.substr('%i18n:@text%'.indexOf('}') + 1) }}

@@ -18,7 +18,7 @@ export default define({ }).extend({ data() { return { - meta: null; + meta: null }; }, created() { From 341f0c933a8e91900968a6b97c96ede1074f92fb Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Sun, 26 Aug 2018 13:55:39 +0900 Subject: [PATCH 3/6] Use endsWith for readability --- src/config/load.ts | 2 +- src/server/api/service/twitter.ts | 2 +- webpack/loaders/replace.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config/load.ts b/src/config/load.ts index 1c59f82b3..8929cf8d3 100644 --- a/src/config/load.ts +++ b/src/config/load.ts @@ -53,5 +53,5 @@ export default function load() { } function normalizeUrl(url: string) { - return url[url.length - 1] === '/' ? url.substr(0, url.length - 1) : url; + return url.endsWith('/') ? url.substr(0, url.length - 1) : url; } diff --git a/src/server/api/service/twitter.ts b/src/server/api/service/twitter.ts index 8c668e832..aad2846bb 100644 --- a/src/server/api/service/twitter.ts +++ b/src/server/api/service/twitter.ts @@ -14,7 +14,7 @@ function getUserToken(ctx: Koa.Context) { function compareOrigin(ctx: Koa.Context) { function normalizeUrl(url: string) { - return url[url.length - 1] === '/' ? url.substr(0, url.length - 1) : url; + return url.endsWith('/') ? url.substr(0, url.length - 1) : url; } const referer = ctx.headers['referer']; diff --git a/webpack/loaders/replace.js b/webpack/loaders/replace.js index fd6bb3617..9f4825e18 100644 --- a/webpack/loaders/replace.js +++ b/webpack/loaders/replace.js @@ -7,7 +7,7 @@ function trim(text, g) { export default function(src) { const fn = options => { const search = options.search; - const g = search[search.length - 1] == 'g'; + const g = search.endsWith('g'); const file = this.resourcePath.replace(/\\/g, '/'); const replace = options.i18n ? global[options.replace].bind(null, { src: file, From 7823be81edda00c85f33da949787b40b376b9a81 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Sun, 26 Aug 2018 14:29:12 +0900 Subject: [PATCH 4/6] Remove delete-invalid-users.js --- cli/delete-invalid-users.js | 40 ------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 cli/delete-invalid-users.js diff --git a/cli/delete-invalid-users.js b/cli/delete-invalid-users.js deleted file mode 100644 index 41bbc2bab..000000000 --- a/cli/delete-invalid-users.js +++ /dev/null @@ -1,40 +0,0 @@ -const { default: User, deleteUser } = require('../built/models/user'); -const { default: zip } = require('@prezzemolo/zip') - -const migrate = async (user) => { - try { - await deleteUser(user._id); - return true; - } catch (e) { - return false; - } -} - -async function main() { - const count = await User.count({ - uri: /#/ - }); - - const dop = 1 - const idop = ((count - (count % dop)) / dop) + 1 - - return zip( - 1, - async (time) => { - console.log(`${time} / ${idop}`) - const doc = await User.find({ - uri: /#/ - }, { - limit: dop, skip: time * dop - }) - return Promise.all(doc.map(migrate)) - }, - idop - ).then(a => { - const rv = [] - a.forEach(e => rv.push(...e)) - return rv - }) -} - -main().then(console.dir).catch(console.error) From 66ced98bf564e73235b3f3b1e086ccba3a23ce9a Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 27 Aug 2018 04:50:52 +0900 Subject: [PATCH 5/6] Fix bug --- src/models/stats.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/models/stats.ts b/src/models/stats.ts index 3041d3852..326bfacc8 100644 --- a/src/models/stats.ts +++ b/src/models/stats.ts @@ -2,7 +2,8 @@ import * as mongo from 'mongodb'; import db from '../db/mongodb'; const Stats = db.get('stats'); -Stats.createIndex({ date: -1 }, { unique: true }); +Stats.dropIndex({ date: -1 }); // 後方互換性のため +Stats.createIndex({ span: -1, date: -1 }, { unique: true }); export default Stats; export interface IStats { From 822539559a2e3b227623215abe8addcda1e22e18 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 27 Aug 2018 04:56:38 +0900 Subject: [PATCH 6/6] 8.15.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8bde6935b..c84f01fc5 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.14.0", - "clientVersion": "1.0.9022", + "version": "8.15.0", + "clientVersion": "1.0.9031", "codename": "nighthike", "main": "./built/index.js", "private": true,