Skip to content

Commit

Permalink
clean up dev logs
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Feb 17, 2025
1 parent 93e7aad commit 34f8345
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
1 change: 0 additions & 1 deletion packages/frontend-shared/js/scroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ export function scrollToBottom(

export function isTopVisible(el: HTMLElement, tolerance = 1): boolean {
const scrollTop = getScrollPosition(el);
if (_DEV_) console.log(scrollTop, tolerance, scrollTop <= tolerance);
return scrollTop <= tolerance;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/global/MkA.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export type MkABehavior = 'window' | 'browser' | null;

<script lang="ts" setup>
import { computed, inject, shallowRef } from 'vue';
import { url } from '@@/js/config.js';
import * as os from '@/os.js';
import { copyToClipboard } from '@/scripts/copy-to-clipboard.js';
import { url } from '@@/js/config.js';
import { i18n } from '@/i18n.js';
import { useRouter } from '@/router/supplier.js';

Expand Down
4 changes: 1 addition & 3 deletions packages/frontend/src/nirax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// NIRAX --- A lightweight router

import { onMounted, shallowRef } from 'vue';
import type { Component, ShallowRef } from 'vue';
import { EventEmitter } from 'eventemitter3';
import type { Component, ShallowRef } from 'vue';

function safeURIDecode(str: string): string {
try {
Expand Down Expand Up @@ -242,8 +242,6 @@ export class Router extends EventEmitter<RouterEvent> implements IRouter {
hash,
};

if (_DEV_) console.log('Routing: ', path, queryString);

function check(routes: RouteDef[], _parts: string[]): Resolved | null {
forEachRouteLoop:
for (const route of routes) {
Expand Down
13 changes: 4 additions & 9 deletions packages/frontend/src/pizzax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// PIZZAX --- A lightweight store

import { onUnmounted, ref, watch } from 'vue';
import type { Ref } from 'vue';
import { BroadcastChannel } from 'broadcast-channel';
import type { Ref } from 'vue';
import { $i } from '@/account.js';
import { misskeyApi } from '@/scripts/misskey-api.js';
import { get, set } from '@/scripts/idb-proxy.js';
Expand Down Expand Up @@ -113,7 +113,6 @@ export class Storage<T extends StateDef> {
this.reactiveState[k].value = this.state[k] = this.mergeState<T[keyof T]['default']>(deviceAccountState[k], v.default);
} else {
this.reactiveState[k].value = this.state[k] = v.default;
if (_DEV_) console.log('Use default value', k, v.default);
}
}

Expand Down Expand Up @@ -180,12 +179,9 @@ export class Storage<T extends StateDef> {
// (JSON.parse(JSON.stringify(value))の代わり)
const rawValue = deepClone(value);

if (_DEV_) console.log('set', key, rawValue, value);

this.reactiveState[key].value = this.state[key] = rawValue;

return this.addIdbSetJob(async () => {
if (_DEV_) console.log(`set ${String(key)} start`);
switch (this.def[key].where) {
case 'device': {
this.pizzaxChannel.postMessage({
Expand Down Expand Up @@ -224,7 +220,6 @@ export class Storage<T extends StateDef> {
break;
}
}
if (_DEV_) console.log(`set ${String(key)} complete`);
});
}

Expand All @@ -247,9 +242,9 @@ export class Storage<T extends StateDef> {
getter?: (v: T[K]['default']) => R,
setter?: (v: R) => T[K]['default'],
): {
get: () => R;
set: (value: R) => void;
} {
get: () => R;
set: (value: R) => void;
} {
const valueRef = ref(this.state[key]);

const stop = watch(this.reactiveState[key], val => {
Expand Down

0 comments on commit 34f8345

Please sign in to comment.