diff --git a/cli/delete-invalid-users.js b/cli/delete-invalid-users.js deleted file mode 100644 index 41bbc2baba..0000000000 --- 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) diff --git a/package.json b/package.json index 8bde6935b8..c84f01fc51 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, diff --git a/src/client/app/common/views/widgets/donation.vue b/src/client/app/common/views/widgets/donation.vue index 470576d5e6..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('{')) }} - @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; + }); + } }); 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/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 { 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,