chore: run lint

This commit is contained in:
naskya 2023-10-22 17:44:32 +09:00
parent e81ed199ae
commit 08cb14a04d
No known key found for this signature in database
GPG Key ID: 164DFF24E2D40139
11 changed files with 68 additions and 65 deletions

View File

@ -100,7 +100,6 @@ function fetchAccount(token: string): Promise<Account> {
if (res.error.id === "a8c724b3-6e9c-4b46-b1a8-bc3ed6258370") { if (res.error.id === "a8c724b3-6e9c-4b46-b1a8-bc3ed6258370") {
showSuspendedDialog(); showSuspendedDialog();
signout(); signout();
return;
} else { } else {
alert({ alert({
type: "error", type: "error",

View File

@ -19,7 +19,10 @@
></i> ></i>
<i <i
v-else-if="type === 'error'" v-else-if="type === 'error'"
:class="[$style.iconInner, iconClass('ph-circle-wavy-warning')]" :class="[
$style.iconInner,
iconClass('ph-circle-wavy-warning'),
]"
></i> ></i>
<i <i
v-else-if="type === 'warning'" v-else-if="type === 'warning'"

View File

@ -50,9 +50,9 @@ import XMedia from "@/components/MkMedia.vue";
import XModPlayer from "@/components/MkModPlayer.vue"; import XModPlayer from "@/components/MkModPlayer.vue";
import * as os from "@/os"; import * as os from "@/os";
import { import {
FILE_EXT_TRACKER_MODULES,
FILE_TYPE_BROWSERSAFE, FILE_TYPE_BROWSERSAFE,
FILE_TYPE_TRACKER_MODULES, FILE_TYPE_TRACKER_MODULES,
FILE_EXT_TRACKER_MODULES,
} from "@/const"; } from "@/const";
const props = defineProps<{ const props = defineProps<{
@ -196,9 +196,7 @@ const previewable = (file: firefish.entities.DriveFile): boolean => {
const isModule = (file: firefish.entities.DriveFile): boolean => { const isModule = (file: firefish.entities.DriveFile): boolean => {
return ( return (
FILE_TYPE_TRACKER_MODULES.some((type) => { FILE_TYPE_TRACKER_MODULES.includes(file.type) ||
return file.type === type;
}) ||
FILE_EXT_TRACKER_MODULES.some((ext) => { FILE_EXT_TRACKER_MODULES.some((ext) => {
return file.name.toLowerCase().endsWith("." + ext); return file.name.toLowerCase().endsWith("." + ext);
}) })

View File

@ -1,33 +1,33 @@
<template> <template>
<div class="mod-player-disabled" v-if="!available"> <div v-if="!available" class="mod-player-disabled">
<MkLoading v-if="fetching" /> <MkLoading v-if="fetching" />
<MkError v-else-if="error" @retry="load()" /> <MkError v-else-if="error" @retry="load()" />
</div> </div>
<div class="mod-player-disabled" v-else-if="hide" @click="toggleVisible()"> <div v-else-if="hide" class="mod-player-disabled" @click="toggleVisible()">
<div> <div>
<b><i class="ph-warning"></i> {{ i18n.ts.sensitive }}</b> <b><i class="ph-warning"></i> {{ i18n.ts.sensitive }}</b>
<span>{{ i18n.ts.clickToShow }}</span> <span>{{ i18n.ts.clickToShow }}</span>
</div> </div>
</div> </div>
<div class="mod-player-enabled" v-else> <div v-else class="mod-player-enabled">
<div class="pattern-display"> <div class="pattern-display">
<div class="mod-pattern" ref="modPattern" v-if="patternShow"> <div v-if="patternShow" ref="modPattern" class="mod-pattern">
<span <span
v-for="(row, i) in patData[currentPattern]" v-for="(row, i) in patData[currentPattern]"
ref="initRow"
v-bind:class="{ modRowActive: isRowActive(i) }"
v-if="patData.length !== 0" v-if="patData.length !== 0"
ref="initRow"
:class="{ modRowActive: isRowActive(i) }"
> >
<span v-bind:class="{ modColQuarter: i % 4 === 0 }">{{ <span :class="{ modColQuarter: i % 4 === 0 }">{{
indexText(i) indexText(i)
}}</span> }}</span>
<span class="mod-row-inner">{{ getRowText(row) }}</span> <span class="mod-row-inner">{{ getRowText(row) }}</span>
</span> </span>
<MkLoading v-else /> <MkLoading v-else />
</div> </div>
<div class="mod-pattern" v-else @click="showPattern()"> <div v-else class="mod-pattern" @click="showPattern()">
<span class="modRowActive" ref="initRow"> <span ref="initRow" class="modRowActive">
<span class="modColQuarter">00</span> <span class="modColQuarter">00</span>
<span class="mod-row-inner">|F-12Ev10XEF</span> <span class="mod-row-inner">|F-12Ev10XEF</span>
</span> </span>
@ -36,39 +36,39 @@
</div> </div>
</div> </div>
<div class="controls"> <div class="controls">
<button class="play" @click="playPause()" v-if="!loading"> <button v-if="!loading" class="play" @click="playPause()">
<i class="ph-pause ph-fill" v-if="playing"></i> <i v-if="playing" class="ph-pause ph-fill"></i>
<i class="ph-play ph-fill" v-else></i> <i v-else class="ph-play ph-fill"></i>
</button> </button>
<MkLoading v-else :em="true" /> <MkLoading v-else :em="true" />
<button class="stop" @click="stop()"> <button class="stop" @click="stop()">
<i class="ph-stop ph-fill"></i> <i class="ph-stop ph-fill"></i>
</button> </button>
<button class="loop" @click="toggleLoop()"> <button class="loop" @click="toggleLoop()">
<i class="ph-repeat ph-fill" v-if="loop === -1"></i> <i v-if="loop === -1" class="ph-repeat ph-fill"></i>
<i class="ph-repeat-once ph-fill" v-else></i> <i v-else class="ph-repeat-once ph-fill"></i>
</button> </button>
<FormRange <FormRange
ref="progress"
v-model="position"
class="progress" class="progress"
:min="0" :min="0"
:max="length" :max="length"
v-model="position"
:step="0.1" :step="0.1"
ref="progress"
:background="false" :background="false"
:tooltips="false" :tooltips="false"
:instant="true" :instant="true"
@update:modelValue="performSeek()" @update:modelValue="performSeek()"
></FormRange> ></FormRange>
<button class="mute" @click="toggleMute()"> <button class="mute" @click="toggleMute()">
<i class="ph-speaker-simple-x ph-fill" v-if="muted"></i> <i v-if="muted" class="ph-speaker-simple-x ph-fill"></i>
<i class="ph-speaker-simple-high ph-fill" v-else></i> <i v-else class="ph-speaker-simple-high ph-fill"></i>
</button> </button>
<FormRange <FormRange
v-model="player.context.gain.value"
class="volume" class="volume"
:min="0" :min="0"
:max="1" :max="1"
v-model="player.context.gain.value"
:step="0.1" :step="0.1"
:background="false" :background="false"
:tooltips="false" :tooltips="false"
@ -106,13 +106,13 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, shallowRef, nextTick, onDeactivated, onMounted } from "vue"; import { nextTick, onDeactivated, onMounted, ref, shallowRef } from "vue";
import * as firefish from "firefish-js"; import type * as firefish from "firefish-js";
import FormRange from "./form/range.vue"; import FormRange from "./form/range.vue";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import * as os from "@/os"; import * as os from "@/os";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
import { ChiptuneJsPlayer, ChiptuneJsConfig } from "@/scripts/chiptune2"; import { ChiptuneJsConfig, ChiptuneJsPlayer } from "@/scripts/chiptune2";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
const props = defineProps<{ const props = defineProps<{
@ -130,25 +130,25 @@ interface ModRow {
const available = ref(false); const available = ref(false);
const initRow = shallowRef<HTMLSpanElement>(); const initRow = shallowRef<HTMLSpanElement>();
const player = shallowRef(new ChiptuneJsPlayer(new ChiptuneJsConfig())); const player = shallowRef(new ChiptuneJsPlayer(new ChiptuneJsConfig()));
let hide = ref( const hide = ref(
defaultStore.state.nsfw === "force" defaultStore.state.nsfw === "force"
? true ? true
: props.module.isSensitive && defaultStore.state.nsfw !== "ignore", : props.module.isSensitive && defaultStore.state.nsfw !== "ignore",
); );
let playing = ref(false); const playing = ref(false);
let patternShow = ref(false); const patternShow = ref(false);
let modPattern = ref<HTMLDivElement>(); const modPattern = ref<HTMLDivElement>();
let progress = ref<typeof FormRange>(); const progress = ref<typeof FormRange>();
let position = ref(0); const position = ref(0);
let patData = shallowRef([] as ModRow[][]); const patData = shallowRef([] as ModRow[][]);
let currentPattern = ref(0); const currentPattern = ref(0);
let nbChannels = ref(0); const nbChannels = ref(0);
let length = ref(1); const length = ref(1);
let muted = ref(false); const muted = ref(false);
let loop = ref(0); const loop = ref(0);
let fetching = ref(true); const fetching = ref(true);
let error = ref(false); const error = ref(false);
let loading = ref(false); const loading = ref(false);
function load() { function load() {
player.value player.value
@ -168,10 +168,10 @@ function load() {
onMounted(load); onMounted(load);
let currentRow = 0; let currentRow = 0,
let rowHeight = 0; rowHeight = 0,
let buffer = null; buffer = null,
let isSeeking = false; isSeeking = false;
function captionPopup() { function captionPopup() {
os.alert({ os.alert({
@ -293,7 +293,6 @@ function isRowActive(i: number) {
} }
return true; return true;
} }
return;
} }
function indexText(i: number) { function indexText(i: number) {
@ -305,11 +304,11 @@ function indexText(i: number) {
} }
function getRow(pattern: number, rowOffset: number) { function getRow(pattern: number, rowOffset: number) {
let notes: string[] = [], const notes: string[] = [];
insts: string[] = [], const insts: string[] = [];
vols: string[] = [], const vols: string[] = [];
fxs: string[] = [], const fxs: string[] = [];
ops: string[] = []; const ops: string[] = [];
for (let channel = 0; channel < nbChannels.value; channel++) { for (let channel = 0; channel < nbChannels.value; channel++) {
const part = player.value.getPatternRowChannel( const part = player.value.getPatternRowChannel(

View File

@ -31,7 +31,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { shallowRef, watch } from "vue"; import { shallowRef, watch } from "vue";
import MkModal from "@/components/MkModal.vue"; import MkModal from "@/components/MkModal.vue";
import iconClass from "@/scripts/icon" import iconClass from "@/scripts/icon";
const modal = shallowRef<InstanceType<typeof MkModal>>(); const modal = shallowRef<InstanceType<typeof MkModal>>();

View File

@ -14,7 +14,6 @@ import "@phosphor-icons/web/light";
import "@phosphor-icons/web/duotone"; import "@phosphor-icons/web/duotone";
// #region account indexedDB migration // #region account indexedDB migration
import { set } from "@/scripts/idb-proxy";
const accounts = localStorage.getItem("accounts"); const accounts = localStorage.getItem("accounts");
if (accounts) { if (accounts) {
@ -32,6 +31,7 @@ import {
watch, watch,
} from "vue"; } from "vue";
import { compareVersions } from "compare-versions"; import { compareVersions } from "compare-versions";
import { set } from "@/scripts/idb-proxy";
import widgets from "@/widgets"; import widgets from "@/widgets";
import directives from "@/directives"; import directives from "@/directives";

View File

@ -24,7 +24,7 @@ export const api = ((
endpoint: string, endpoint: string,
data: Record<string, any> = {}, data: Record<string, any> = {},
token?: string | null | undefined, token?: string | null | undefined,
useToken: boolean = true, useToken = true,
) => { ) => {
pendingApiRequestsCount.value++; pendingApiRequestsCount.value++;

View File

@ -2,7 +2,11 @@
<div ref="el" class="fdidabkc" :style="{ background: bg }" @click="onClick"> <div ref="el" class="fdidabkc" :style="{ background: bg }" @click="onClick">
<template v-if="metadata"> <template v-if="metadata">
<div class="titleContainer" @click="showTabsPopup"> <div class="titleContainer" @click="showTabsPopup">
<i v-if="metadata.icon" class="icon" :class="icon(metadata.icon)"></i> <i
v-if="metadata.icon"
class="icon"
:class="icon(metadata.icon)"
></i>
<div class="title"> <div class="title">
<div class="title">{{ metadata.title }}</div> <div class="title">{{ metadata.title }}</div>
@ -63,7 +67,7 @@ import { scrollToTop } from "@/scripts/scroll";
import MkButton from "@/components/MkButton.vue"; import MkButton from "@/components/MkButton.vue";
import { globalEvents } from "@/events"; import { globalEvents } from "@/events";
import { injectPageMetadata } from "@/scripts/page-metadata"; import { injectPageMetadata } from "@/scripts/page-metadata";
import icon from "@/scripts/icon" import icon from "@/scripts/icon";
interface Tab { interface Tab {
key?: string | null; key?: string | null;

View File

@ -105,14 +105,14 @@ export function getWordSoftMute(
} }
} }
if (mutedLangs.length > 0) { if (mutedLangs.length > 0) {
let noteLangMuted = checkLangMute(note, mutedLangs); const noteLangMuted = checkLangMute(note, mutedLangs);
if (noteLangMuted.muted) { if (noteLangMuted.muted) {
noteLangMuted.what = "note"; noteLangMuted.what = "note";
return noteLangMuted; return noteLangMuted;
} }
if (note.renote) { if (note.renote) {
let renoteLangMuted = checkLangMute(note, mutedLangs); const renoteLangMuted = checkLangMute(note, mutedLangs);
if (renoteLangMuted.muted) { if (renoteLangMuted.muted) {
renoteLangMuted.what = note.text == null ? "renote" : "quote"; renoteLangMuted.what = note.text == null ? "renote" : "quote";
return renoteLangMuted; return renoteLangMuted;
@ -120,7 +120,7 @@ export function getWordSoftMute(
} }
if (note.reply) { if (note.reply) {
let replyLangMuted = checkLangMute(note, mutedLangs); const replyLangMuted = checkLangMute(note, mutedLangs);
if (replyLangMuted.muted) { if (replyLangMuted.muted) {
replyLangMuted.what = "reply"; replyLangMuted.what = "reply";
return replyLangMuted; return replyLangMuted;

View File

@ -309,9 +309,9 @@ ChiptuneJsPlayer.prototype.createLibopenmptNode = async function (
} }
return; return;
} }
let framesRendered = 0; let framesRendered = 0,
let ended = false; ended = false,
let error = false; error = false;
const currentPattern = const currentPattern =
processNode.player.libopenmpt._openmpt_module_get_current_pattern( processNode.player.libopenmpt._openmpt_module_get_current_pattern(

View File

@ -132,8 +132,8 @@
<button <button
v-if="isMobile && mainRouter.currentRoute.value.name === 'index'" v-if="isMobile && mainRouter.currentRoute.value.name === 'index'"
v-vibrate="5"
ref="postButton" ref="postButton"
v-vibrate="5"
:aria-label="i18n.t('note')" :aria-label="i18n.t('note')"
class="postButton button post _button" class="postButton button post _button"
@click="os.post()" @click="os.post()"