Lint
This commit is contained in:
parent
dc6121598f
commit
fb06af0a37
3 changed files with 11 additions and 12 deletions
|
|
@ -19,13 +19,13 @@
|
|||
import "./ytmStyles.css";
|
||||
|
||||
import { ImageIcon, LinkIcon, OpenExternalIcon } from "@components/Icons";
|
||||
import { SeekBar } from "@plugins/spotifyControls/SeekBar";
|
||||
import { debounce } from "@shared/debounce";
|
||||
import { openImageModal } from "@utils/discord";
|
||||
import { classes, copyWithToast } from "@utils/misc";
|
||||
import { ContextMenuApi, Flex, FluxDispatcher, Forms, Menu, React, useEffect, useState, useStateFromStores } from "@webpack/common";
|
||||
|
||||
import { type PlayerState, type Repeat, YoutubeMusicStore } from "./YtmStore";
|
||||
import { SeekBar } from "@plugins/spotifyControls/SeekBar";
|
||||
|
||||
const cl = (className: string) => `vc-ytm-${className}`;
|
||||
|
||||
|
|
@ -167,7 +167,6 @@ function YtmSeekBar() {
|
|||
|
||||
const [position, setPosition] = useState<number>(storePosition);
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
useEffect(() => {
|
||||
if (isPlaying && !isSettingPosition) {
|
||||
setPosition(YoutubeMusicStore.position);
|
||||
|
|
|
|||
|
|
@ -57,12 +57,12 @@ export type Repeat = "NONE" | "ONE" | "ALL";
|
|||
|
||||
const nextRepeat = (repeat: Repeat) => {
|
||||
switch (repeat) {
|
||||
case 'NONE':
|
||||
return 'ALL' as const;
|
||||
case 'ALL':
|
||||
return 'ONE' as const;
|
||||
case 'ONE':
|
||||
return 'NONE' as const;
|
||||
case "NONE":
|
||||
return "ALL" as const;
|
||||
case "ALL":
|
||||
return "ONE" as const;
|
||||
case "ONE":
|
||||
return "NONE" as const;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -175,7 +175,7 @@ export const YoutubeMusicStore = proxyLazyWebpack(() => {
|
|||
if (message.song) {
|
||||
store.song = message.song;
|
||||
store.position = message.song.elapsedSeconds ?? 0;
|
||||
};
|
||||
}
|
||||
if (message.isPlaying != null) store.isPlaying = message.isPlaying;
|
||||
if (message.position && message.position !== store.position) store.position = message.position ?? 0;
|
||||
if (message.volume) store.volume = message.volume ?? 0;
|
||||
|
|
@ -271,7 +271,7 @@ export const YoutubeMusicStore = proxyLazyWebpack(() => {
|
|||
}
|
||||
|
||||
private req(method: "post" | "get" | "put", route: string, data: any = {}) {
|
||||
const apiServerUrl = Settings.plugins.YouTubeMusicControls.apiServerUrl;
|
||||
const { apiServerUrl } = Settings.plugins.YouTubeMusicControls;
|
||||
if (apiServerUrl === "") return;
|
||||
console.log(fetch(apiServerUrl + route, {
|
||||
method,
|
||||
|
|
@ -290,4 +290,4 @@ export const YoutubeMusicStore = proxyLazyWebpack(() => {
|
|||
|
||||
function restartSocket() {
|
||||
YoutubeMusicStore.socket.reconnect();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ export default definePlugin({
|
|||
}]
|
||||
}],
|
||||
isPrivateChannelRead(message: MessageJSON) {
|
||||
const ignoreList = settings.store.ignoreUsers.split(", ").filter(Boolean)
|
||||
const ignoreList = settings.store.ignoreUsers.split(", ").filter(Boolean);
|
||||
if (ignoreList.includes(message.author.id)) return true;
|
||||
const channelType = ChannelStore.getChannel(message.channel_id)?.type;
|
||||
if (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue