From 2d2e16d9f60bd31c90eb9fb62cf490b08dd754ce 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: donation、configのmaintainerを参照するよう変更 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(-) (limited to 'src') diff --git a/src/client/app/common/views/widgets/donation.vue b/src/client/app/common/views/widgets/donation.vue index 470576d5e6..4bc71b2b78 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; + }); + } }); -- cgit v1.2.3-freya From 3f30a69b8b11b584acc0eb934a339763b068806c 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: fix --- src/client/app/common/views/widgets/donation.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/app/common/views/widgets/donation.vue b/src/client/app/common/views/widgets/donation.vue index 4bc71b2b78..b1352e803e 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() { -- cgit v1.2.3-freya From bfed1475bbdd1941bb9b12e5ad772ab0f5840bb4 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Sun, 26 Aug 2018 13:55:39 +0900 Subject: 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(-) (limited to 'src') diff --git a/src/config/load.ts b/src/config/load.ts index 1c59f82b3e..8929cf8d3e 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 8c668e832a..aad2846bb4 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 fd6bb3617b..9f4825e18c 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, -- cgit v1.2.3-freya From 33dfc21e4b88f22c4a8d836fcf4b72f9960c8039 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 27 Aug 2018 04:50:52 +0900 Subject: Fix bug --- src/models/stats.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/models/stats.ts b/src/models/stats.ts index 3041d3852b..326bfacc80 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 { -- cgit v1.2.3-freya