From 82854236f3006a3b01dc5e90925e92db25ea0a65 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 7 Jan 2022 15:05:45 +0900 Subject: [PATCH] clean up --- .../src/components/taskmanager.api-window.vue | 72 ------ .../client/src/components/taskmanager.vue | 234 ------------------ packages/client/src/os.ts | 28 +-- packages/client/src/pages/settings/other.vue | 5 - 4 files changed, 1 insertion(+), 338 deletions(-) delete mode 100644 packages/client/src/components/taskmanager.api-window.vue delete mode 100644 packages/client/src/components/taskmanager.vue diff --git a/packages/client/src/components/taskmanager.api-window.vue b/packages/client/src/components/taskmanager.api-window.vue deleted file mode 100644 index 6ec4da3a59..0000000000 --- a/packages/client/src/components/taskmanager.api-window.vue +++ /dev/null @@ -1,72 +0,0 @@ - - - - - diff --git a/packages/client/src/components/taskmanager.vue b/packages/client/src/components/taskmanager.vue deleted file mode 100644 index c5d2c6d8f8..0000000000 --- a/packages/client/src/components/taskmanager.vue +++ /dev/null @@ -1,234 +0,0 @@ - - - - - diff --git a/packages/client/src/os.ts b/packages/client/src/os.ts index d9400103f5..e6dd4567f7 100644 --- a/packages/client/src/os.ts +++ b/packages/client/src/os.ts @@ -4,16 +4,13 @@ import { Component, defineAsyncComponent, markRaw, reactive, Ref, ref } from 'vu import { EventEmitter } from 'eventemitter3'; import insertTextAtCursor from 'insert-text-at-cursor'; import * as Misskey from 'misskey-js'; -import { apiUrl, debug, url } from '@/config'; +import { apiUrl, url } from '@/config'; import MkPostFormDialog from '@/components/post-form-dialog.vue'; import MkWaitingDialog from '@/components/waiting-dialog.vue'; import { resolve } from '@/router'; import { $i } from '@/account'; -import { defaultStore } from '@/store'; export const pendingApiRequestsCount = ref(0); -let apiRequestsCount = 0; // for debug -export const apiRequests = ref([]); // for debug const apiClient = new Misskey.api.APIClient({ origin: url, @@ -26,18 +23,6 @@ export const api = ((endpoint: string, data: Record = {}, token?: s pendingApiRequestsCount.value--; }; - const log = debug ? reactive({ - id: ++apiRequestsCount, - endpoint, - req: markRaw(data), - res: null, - state: 'pending', - }) : null; - if (debug) { - apiRequests.value.push(log); - if (apiRequests.value.length > 128) apiRequests.value.shift(); - } - const promise = new Promise((resolve, reject) => { // Append a credential if ($i) (data as any).i = $i.token; @@ -54,21 +39,10 @@ export const api = ((endpoint: string, data: Record = {}, token?: s if (res.status === 200) { resolve(body); - if (debug) { - log!.res = markRaw(JSON.parse(JSON.stringify(body))); - log!.state = 'success'; - } } else if (res.status === 204) { resolve(); - if (debug) { - log!.state = 'success'; - } } else { reject(body.error); - if (debug) { - log!.res = markRaw(body.error); - log!.state = 'failed'; - } } }).catch(reject); }); diff --git a/packages/client/src/pages/settings/other.vue b/packages/client/src/pages/settings/other.vue index acc1fb4d3e..7547013832 100644 --- a/packages/client/src/pages/settings/other.vue +++ b/packages/client/src/pages/settings/other.vue @@ -63,11 +63,6 @@ export default defineComponent({ injectFeaturedNote: v }); }, - - taskmanager() { - os.popup(import('@/components/taskmanager.vue'), { - }, {}, 'closed'); - }, } });