From 3ccead57fc01aa95357f18859136d6bda9cabf61 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:41:32 -0400 Subject: [PATCH] Misc Updates & Actions Updates --- .github/workflows/build.yml | 13 +- .github/workflows/nixosBuild.yml | 11 +- .github/workflows/publish.yml | 135 +++---- .github/workflows/test.yml | 2 - .../hideServers/HiddenServersStore.ts | 2 +- src/equicordplugins/holyNotes/NoteHandler.ts | 339 +++++++++--------- .../holyNotes/components/modals/HelpModal.tsx | 2 +- .../holyNotes/components/modals/Notebook.tsx | 2 +- .../components/modals/NotebookCreateModal.tsx | 2 +- .../components/modals/NotebookDeleteModal.tsx | 2 +- .../components/modals/RenderMessage.tsx | 2 +- src/equicordplugins/holyNotes/index.tsx | 2 +- src/equicordplugins/holyNotes/utils.ts | 2 +- .../musicControls/tidal/TidalStore.ts | 2 +- .../musicControls/youtubeMusic/YtmStore.ts | 8 +- 15 files changed, 266 insertions(+), 260 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2050ad109..3aad90721 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,11 +6,12 @@ on: env: FORCE_COLOR: true - GITHUB_TOKEN: ${{ secrets.ETOKEN }} + GITHUB_TOKEN: ${{ github.token }} REPO: Equicord/Equibored USERNAME: GitHub-Actions -permissions: write-all +permissions: + contents: write jobs: Build: @@ -39,10 +40,10 @@ jobs: - name: Generate plugin lists run: | - pnpm generatePluginJson dist/plugins.json - pnpm generateEquicordPluginJson dist/equicordplugins.json - pnpm generateVencordPluginJson dist/vencordplugins.json - pnpm generateDevsList dist/devs.json + pnpm generatePluginJson dist/plugins.json + pnpm generateEquicordPluginJson dist/equicordplugins.json + pnpm generateVencordPluginJson dist/vencordplugins.json + pnpm generateDevsList dist/devs.json - name: Collect files to be released run: | diff --git a/.github/workflows/nixosBuild.yml b/.github/workflows/nixosBuild.yml index 50d7638ff..0b828ba9a 100644 --- a/.github/workflows/nixosBuild.yml +++ b/.github/workflows/nixosBuild.yml @@ -7,7 +7,8 @@ env: FORCE_COLOR: true GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -permissions: write-all +permissions: + contents: write jobs: Build: @@ -36,10 +37,10 @@ jobs: - name: Generate plugin lists run: | - pnpm generatePluginJson dist/plugins.json - pnpm generateEquicordPluginJson dist/equicordplugins.json - pnpm generateVencordPluginJson dist/vencordplugins.json - pnpm generateDevsList dist/devs.json + pnpm generatePluginJson dist/plugins.json + pnpm generateEquicordPluginJson dist/equicordplugins.json + pnpm generateVencordPluginJson dist/vencordplugins.json + pnpm generateDevsList dist/devs.json - name: Collect files to be released run: | diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4117a2065..add75c8a8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,88 +1,89 @@ name: Release Browser Extension on: - push: - branches: - - main + push: + branches: + - main env: FORCE_COLOR: true -permissions: write-all +permissions: + contents: write jobs: - release: - runs-on: ubuntu-latest + release: + runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Get package.json version - id: pkg - run: echo "version=v$(jq -r .version < package.json)" >> $GITHUB_OUTPUT + - name: Get package.json version + id: pkg + run: echo "version=v$(jq -r .version < package.json)" >> $GITHUB_OUTPUT - - name: Get latest Git tag - id: tag - run: | - latest_tag=$(git tag --list 'v*' --sort=-v:refname | head -n 1 || echo "v0.0.0") - echo "latest=$latest_tag" >> $GITHUB_OUTPUT + - name: Get latest Git tag + id: tag + run: | + latest_tag=$(git tag --list 'v*' --sort=-v:refname | head -n 1 || echo "v0.0.0") + echo "latest=$latest_tag" >> $GITHUB_OUTPUT - - name: Check if package.json version is newer - id: check - run: | - pkg="${{ steps.pkg.outputs.version }}" - latest="${{ steps.tag.outputs.latest }}" + - name: Check if package.json version is newer + id: check + run: | + pkg="${{ steps.pkg.outputs.version }}" + latest="${{ steps.tag.outputs.latest }}" - echo "Latest tag: $latest" - echo "Package version: $pkg" + echo "Latest tag: $latest" + echo "Package version: $pkg" - if [ "$pkg" != "$latest" ] && [ "$(sort -V <<<"$latest"$'\n'"$pkg" | tail -n1)" = "$pkg" ]; then - echo "release=true" >> $GITHUB_OUTPUT - else - echo "release=false" >> $GITHUB_OUTPUT - fi + if [ "$pkg" != "$latest" ] && [ "$(sort -V <<<"$latest"$'\n'"$pkg" | tail -n1)" = "$pkg" ]; then + echo "release=true" >> $GITHUB_OUTPUT + else + echo "release=false" >> $GITHUB_OUTPUT + fi - - name: Stop if not newer - if: steps.check.outputs.release == 'false' - run: | - echo "No new version to release (package.json ${{ steps.pkg.outputs.version }} <= latest tag ${{ steps.tag.outputs.latest }})" - exit 0 + - name: Stop if not newer + if: steps.check.outputs.release == 'false' + run: | + echo "No new version to release (package.json ${{ steps.pkg.outputs.version }} <= latest tag ${{ steps.tag.outputs.latest }})" + exit 0 - - name: Create Tag - if: steps.check.outputs.release == 'true' - uses: butlerlogic/action-autotag@1.1.2 - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - with: - tag_prefix: "v" + - name: Create Tag + if: steps.check.outputs.release == 'true' + uses: butlerlogic/action-autotag@1.1.2 + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + with: + tag_prefix: "v" - - name: Setup PNPM - if: steps.check.outputs.release == 'true' - uses: pnpm/action-setup@v3 + - name: Setup PNPM + if: steps.check.outputs.release == 'true' + uses: pnpm/action-setup@v3 - - name: Use Node.js 20 - if: steps.check.outputs.release == 'true' - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: "pnpm" + - name: Use Node.js 20 + if: steps.check.outputs.release == 'true' + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "pnpm" - - name: Install dependencies - if: steps.check.outputs.release == 'true' - run: pnpm install --frozen-lockfile + - name: Install dependencies + if: steps.check.outputs.release == 'true' + run: pnpm install --frozen-lockfile - - name: Build web - if: steps.check.outputs.release == 'true' - run: pnpm buildWebStandalone + - name: Build web + if: steps.check.outputs.release == 'true' + run: pnpm buildWebStandalone - - name: Publish extension - if: steps.check.outputs.release == 'true' - run: | - cd dist/browser/chromium-unpacked - pnpx chrome-webstore-upload-cli@2.1.0 upload --auto-publish - env: - EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }} - CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }} - CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }} - REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }} + - name: Publish extension + if: steps.check.outputs.release == 'true' + run: | + cd dist/browser/chromium-unpacked + pnpx chrome-webstore-upload-cli@2.1.0 upload --auto-publish + env: + EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }} + CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }} + CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }} + REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0c56e36c0..708974e68 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,8 +9,6 @@ on: - main - dev -permissions: write-all - jobs: Test: name: Test diff --git a/src/equicordplugins/hideServers/HiddenServersStore.ts b/src/equicordplugins/hideServers/HiddenServersStore.ts index af3d4ec9a..ea697fed7 100644 --- a/src/equicordplugins/hideServers/HiddenServersStore.ts +++ b/src/equicordplugins/hideServers/HiddenServersStore.ts @@ -31,7 +31,7 @@ export const HiddenServersStore = proxyLazyWebpack(() => { this._hiddenGuilds.clear(); } - private save() { + public save() { DataStore.set(DB_KEY, this._hiddenGuilds); } diff --git a/src/equicordplugins/holyNotes/NoteHandler.ts b/src/equicordplugins/holyNotes/NoteHandler.ts index a501b9852..395596070 100644 --- a/src/equicordplugins/holyNotes/NoteHandler.ts +++ b/src/equicordplugins/holyNotes/NoteHandler.ts @@ -6,6 +6,7 @@ import { makeDummyUser } from "@components/settings/tabs/plugins/PluginModal"; import { Channel, Message } from "@vencord/discord-types"; +import { proxyLazyWebpack } from "@webpack"; import { ChannelStore, lodash, Toasts, UserStore } from "@webpack/common"; import { Discord, HolyNotes } from "./types"; @@ -13,197 +14,201 @@ import { deleteCacheFromDataStore, DeleteEntireStore, saveCacheToDataStore } fro export const noteHandlerCache = new Map(); -export default new (class NoteHandler { - private _formatNote(channel: Channel, message: Message): HolyNotes.Note { - return { - id: message.id, - channel_id: message.channel_id, - guild_id: channel.guild_id, - content: message.content, - author: { - id: message.author.id, - avatar: message.author.avatar, - discriminator: message.author.discriminator, - username: message.author.username, - }, - flags: message.flags, - // Moment has a toString() function, this doesn't convert to '[object Object]'. +export const noteHandler = proxyLazyWebpack(() => { + class NoteHandler { + public _formatNote(channel: Channel, message: Message): HolyNotes.Note { + return { + id: message.id, + channel_id: message.channel_id, + guild_id: channel.guild_id, + content: message.content, + author: { + id: message.author.id, + avatar: message.author.avatar, + discriminator: message.author.discriminator, + username: message.author.username, + }, + flags: message.flags, + // Moment has a toString() function, this doesn't convert to '[object Object]'. - timestamp: message.timestamp.toString(), - attachments: message.attachments as Discord.Attachment[], - embeds: message.embeds, - reactions: message.reactions as Discord.Reaction[], - stickerItems: message.stickerItems, - }; - } - - - public getNotes(notebook?: string): Record { - return noteHandlerCache.get(notebook); - } - - public getAllNotes(): HolyNotes.Note[] { - const data = noteHandlerCache.entries(); - const notes = {}; - for (const [key, value] of data) { - notes[key] = value; + timestamp: message.timestamp.toString(), + attachments: message.attachments as Discord.Attachment[], + embeds: message.embeds, + reactions: message.reactions as Discord.Reaction[], + stickerItems: message.stickerItems, + }; } - return notes as HolyNotes.Note[]; - } - - public addNote = async (message: Message, notebook: string) => { - const notes = this.getNotes(notebook); - const channel = ChannelStore.getChannel(message.channel_id); - const newNotes = Object.assign({ [message.id]: this._formatNote(channel, message) }, notes); - - noteHandlerCache.set(notebook, newNotes); - saveCacheToDataStore(notebook, newNotes as unknown as HolyNotes.Note[]); - - Toasts.show({ - id: Toasts.genId(), - message: `Successfully added note to ${notebook}.`, - type: Toasts.Type.SUCCESS, - }); - }; - - public deleteNote = async (noteId: string, notebook: string) => { - const notes = this.getNotes(notebook); - - noteHandlerCache.set(notebook, lodash.omit(notes, noteId)); - saveCacheToDataStore(notebook, lodash.omit(notes, noteId) as unknown as HolyNotes.Note[]); - - Toasts.show({ - id: Toasts.genId(), - message: `Successfully deleted note from ${notebook}.`, - type: Toasts.Type.SUCCESS, - }); - }; - - public moveNote = async (note: HolyNotes.Note, from: string, to: string) => { - const origNotebook = this.getNotes(from); - const newNoteBook = lodash.cloneDeep(this.getNotes(to)); - - newNoteBook[note.id] = note; - - noteHandlerCache.set(from, lodash.omit(origNotebook, note.id)); - noteHandlerCache.set(to, newNoteBook); - - saveCacheToDataStore(from, lodash.omit(origNotebook, note.id) as unknown as HolyNotes.Note[]); - saveCacheToDataStore(to, newNoteBook as unknown as HolyNotes.Note[]); - Toasts.show({ - id: Toasts.genId(), - message: `Successfully moved note from ${from} to ${to}.`, - type: Toasts.Type.SUCCESS, - }); - }; + public getNotes(notebook?: string): Record { + return noteHandlerCache.get(notebook); + } - public newNoteBook = async (notebookName: string, silent?: Boolean) => { - let notebookExists = false; - - for (const key of noteHandlerCache.keys()) { - if (key === notebookName) { - notebookExists = true; - break; + public getAllNotes(): HolyNotes.Note[] { + const data = noteHandlerCache.entries(); + const notes = {}; + for (const [key, value] of data) { + notes[key] = value; } + return notes as HolyNotes.Note[]; } - if (notebookExists) { + public addNote = async (message: Message, notebook: string) => { + const notes = this.getNotes(notebook); + const channel = ChannelStore.getChannel(message.channel_id); + const newNotes = Object.assign({ [message.id]: this._formatNote(channel, message) }, notes); + + noteHandlerCache.set(notebook, newNotes); + saveCacheToDataStore(notebook, newNotes as unknown as HolyNotes.Note[]); + Toasts.show({ id: Toasts.genId(), - message: `Notebook ${notebookName} already exists.`, - type: Toasts.Type.FAILURE, + message: `Successfully added note to ${notebook}.`, + type: Toasts.Type.SUCCESS, }); - return; - } + }; - noteHandlerCache.set(notebookName, {}); - saveCacheToDataStore(notebookName, {} as HolyNotes.Note[]); + public deleteNote = async (noteId: string, notebook: string) => { + const notes = this.getNotes(notebook); - if (!silent) return Toasts.show({ - id: Toasts.genId(), - message: `Successfully created ${notebookName}.`, - type: Toasts.Type.SUCCESS, - }); - }; + noteHandlerCache.set(notebook, lodash.omit(notes, noteId)); + saveCacheToDataStore(notebook, lodash.omit(notes, noteId) as unknown as HolyNotes.Note[]); - public deleteNotebook = async (notebookName: string) => { - noteHandlerCache.delete(notebookName); - deleteCacheFromDataStore(notebookName); + Toasts.show({ + id: Toasts.genId(), + message: `Successfully deleted note from ${notebook}.`, + type: Toasts.Type.SUCCESS, + }); + }; - Toasts.show({ - id: Toasts.genId(), - message: `Successfully deleted ${notebookName}.`, - type: Toasts.Type.SUCCESS, - }); - }; + public moveNote = async (note: HolyNotes.Note, from: string, to: string) => { + const origNotebook = this.getNotes(from); + const newNoteBook = lodash.cloneDeep(this.getNotes(to)); - public refreshAvatars = async () => { - const notebooks = this.getAllNotes(); + newNoteBook[note.id] = note; - for (const notebook in notebooks) - for (const noteId in notebooks[notebook]) { - const note = notebooks[notebook][noteId]; - const user = UserStore.getUser(note.author.id) ?? makeDummyUser(note.author); + noteHandlerCache.set(from, lodash.omit(origNotebook, note.id)); + noteHandlerCache.set(to, newNoteBook); - Object.assign(notebooks[notebook][noteId].author, { - avatar: user.avatar, - discriminator: user.discriminator, - username: user.username, + saveCacheToDataStore(from, lodash.omit(origNotebook, note.id) as unknown as HolyNotes.Note[]); + saveCacheToDataStore(to, newNoteBook as unknown as HolyNotes.Note[]); + + + Toasts.show({ + id: Toasts.genId(), + message: `Successfully moved note from ${from} to ${to}.`, + type: Toasts.Type.SUCCESS, + }); + }; + + public newNoteBook = async (notebookName: string, silent?: Boolean) => { + let notebookExists = false; + + for (const key of noteHandlerCache.keys()) { + if (key === notebookName) { + notebookExists = true; + break; + } + } + + if (notebookExists) { + Toasts.show({ + id: Toasts.genId(), + message: `Notebook ${notebookName} already exists.`, + type: Toasts.Type.FAILURE, + }); + return; + } + + noteHandlerCache.set(notebookName, {}); + saveCacheToDataStore(notebookName, {} as HolyNotes.Note[]); + + if (!silent) return Toasts.show({ + id: Toasts.genId(), + message: `Successfully created ${notebookName}.`, + type: Toasts.Type.SUCCESS, + }); + }; + + public deleteNotebook = async (notebookName: string) => { + noteHandlerCache.delete(notebookName); + deleteCacheFromDataStore(notebookName); + + Toasts.show({ + id: Toasts.genId(), + message: `Successfully deleted ${notebookName}.`, + type: Toasts.Type.SUCCESS, + }); + }; + + public refreshAvatars = async () => { + const notebooks = this.getAllNotes(); + + for (const notebook in notebooks) + for (const noteId in notebooks[notebook]) { + const note = notebooks[notebook][noteId]; + const user = UserStore.getUser(note.author.id) ?? makeDummyUser(note.author); + + Object.assign(notebooks[notebook][noteId].author, { + avatar: user.avatar, + discriminator: user.discriminator, + username: user.username, + }); + } + + for (const notebook in notebooks) { + noteHandlerCache.set(notebook, notebooks[notebook]); + saveCacheToDataStore(notebook, notebooks[notebook] as unknown as HolyNotes.Note[]); + } + + Toasts.show({ + id: Toasts.genId(), + message: "Successfully refreshed avatars.", + type: Toasts.Type.SUCCESS, + }); + + }; + + public deleteEverything = async () => { + noteHandlerCache.clear(); + await DeleteEntireStore(); + + Toasts.show({ + id: Toasts.genId(), + message: "Successfully deleted all notes.", + type: Toasts.Type.SUCCESS, + }); + }; + + public exportNotes = async () => { + return this.getAllNotes(); + }; + + public importNotes = async (notes: HolyNotes.Note[]) => { + try { + var parseNotes = JSON.parse(notes as unknown as string); + } catch (e) { + console.log(e); + return Toasts.show({ + id: Toasts.genId(), + message: "Invalid JSON.", + type: Toasts.Type.FAILURE, }); } - for (const notebook in notebooks) { - noteHandlerCache.set(notebook, notebooks[notebook]); - saveCacheToDataStore(notebook, notebooks[notebook] as unknown as HolyNotes.Note[]); - } + for (const notebook in parseNotes) { + noteHandlerCache.set(notebook, parseNotes[notebook]); + saveCacheToDataStore(notebook, parseNotes[notebook] as unknown as HolyNotes.Note[]); + } - Toasts.show({ - id: Toasts.genId(), - message: "Successfully refreshed avatars.", - type: Toasts.Type.SUCCESS, - }); - - }; - - public deleteEverything = async () => { - noteHandlerCache.clear(); - await DeleteEntireStore(); - - Toasts.show({ - id: Toasts.genId(), - message: "Successfully deleted all notes.", - type: Toasts.Type.SUCCESS, - }); - }; - - public exportNotes = async () => { - return this.getAllNotes(); - }; - - public importNotes = async (notes: HolyNotes.Note[]) => { - try { - var parseNotes = JSON.parse(notes as unknown as string); - } catch (e) { - console.log(e); - return Toasts.show({ + Toasts.show({ id: Toasts.genId(), - message: "Invalid JSON.", - type: Toasts.Type.FAILURE, + message: "Successfully imported notes.", + type: Toasts.Type.SUCCESS, }); - } - for (const notebook in parseNotes) { - noteHandlerCache.set(notebook, parseNotes[notebook]); - saveCacheToDataStore(notebook, parseNotes[notebook] as unknown as HolyNotes.Note[]); - } + }; + } - Toasts.show({ - id: Toasts.genId(), - message: "Successfully imported notes.", - type: Toasts.Type.SUCCESS, - }); - - }; + return new NoteHandler(); }); diff --git a/src/equicordplugins/holyNotes/components/modals/HelpModal.tsx b/src/equicordplugins/holyNotes/components/modals/HelpModal.tsx index 4421bd3c7..0c3b64fae 100644 --- a/src/equicordplugins/holyNotes/components/modals/HelpModal.tsx +++ b/src/equicordplugins/holyNotes/components/modals/HelpModal.tsx @@ -10,7 +10,7 @@ import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, M import { findByProps } from "@webpack"; import { Button } from "@webpack/common"; -import noteHandler from "../../NoteHandler"; +import { noteHandler } from "../../NoteHandler"; import { downloadNotes, uploadNotes } from "../../utils"; export default ({ onClose, ...modalProps }: ModalProps & { onClose: () => void; }) => { diff --git a/src/equicordplugins/holyNotes/components/modals/Notebook.tsx b/src/equicordplugins/holyNotes/components/modals/Notebook.tsx index 719cfb585..a2c1b6f06 100644 --- a/src/equicordplugins/holyNotes/components/modals/Notebook.tsx +++ b/src/equicordplugins/holyNotes/components/modals/Notebook.tsx @@ -11,7 +11,7 @@ import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, M import { findByProps } from "@webpack"; import { ContextMenuApi, Flex, FluxDispatcher, Menu, React, TextInput } from "@webpack/common"; -import noteHandler from "../../NoteHandler"; +import { noteHandler } from "../../NoteHandler"; import { HolyNotes } from "../../types"; import HelpIcon from "../icons/HelpIcon"; import Errors from "./Error"; diff --git a/src/equicordplugins/holyNotes/components/modals/NotebookCreateModal.tsx b/src/equicordplugins/holyNotes/components/modals/NotebookCreateModal.tsx index 53f368ae6..7b8e4ae6a 100644 --- a/src/equicordplugins/holyNotes/components/modals/NotebookCreateModal.tsx +++ b/src/equicordplugins/holyNotes/components/modals/NotebookCreateModal.tsx @@ -8,7 +8,7 @@ import { HeadingSecondary } from "@components/Heading"; import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize } from "@utils/modal"; import { Button, React, TextInput } from "@webpack/common"; -import noteHandler from "../../NoteHandler"; +import { noteHandler } from "../../NoteHandler"; export default (props: ModalProps & { onClose: () => void; }) => { const [notebookName, setNotebookName] = React.useState(""); diff --git a/src/equicordplugins/holyNotes/components/modals/NotebookDeleteModal.tsx b/src/equicordplugins/holyNotes/components/modals/NotebookDeleteModal.tsx index 86ce3e5e6..bac2dd92b 100644 --- a/src/equicordplugins/holyNotes/components/modals/NotebookDeleteModal.tsx +++ b/src/equicordplugins/holyNotes/components/modals/NotebookDeleteModal.tsx @@ -9,7 +9,7 @@ import { HeadingSecondary } from "@components/Heading"; import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize } from "@utils/modal"; import { Button, React } from "@webpack/common"; -import noteHandler from "../../NoteHandler"; +import { noteHandler } from "../../NoteHandler"; import Error from "./Error"; import { RenderMessage } from "./RenderMessage"; diff --git a/src/equicordplugins/holyNotes/components/modals/RenderMessage.tsx b/src/equicordplugins/holyNotes/components/modals/RenderMessage.tsx index 20aa0907c..b1a9c11f7 100644 --- a/src/equicordplugins/holyNotes/components/modals/RenderMessage.tsx +++ b/src/equicordplugins/holyNotes/components/modals/RenderMessage.tsx @@ -12,7 +12,7 @@ import { ModalProps } from "@utils/modal"; import { findByCodeLazy, findByProps, findComponentByCodeLazy } from "@webpack"; import { ContextMenuApi, FluxDispatcher, Menu, NavigationRouter, React } from "@webpack/common"; -import noteHandler from "../../NoteHandler"; +import { noteHandler } from "../../NoteHandler"; import { HolyNotes } from "../../types"; export const RenderMessage = ({ diff --git a/src/equicordplugins/holyNotes/index.tsx b/src/equicordplugins/holyNotes/index.tsx index 0981ffcd6..03c19229b 100644 --- a/src/equicordplugins/holyNotes/index.tsx +++ b/src/equicordplugins/holyNotes/index.tsx @@ -32,7 +32,7 @@ import { ChannelStore, Menu } from "@webpack/common"; import { Popover as NoteButtonPopover, Popover } from "./components/icons/NoteButton"; import { NoteModal } from "./components/modals/Notebook"; -import noteHandler, { noteHandlerCache } from "./NoteHandler"; +import { noteHandler, noteHandlerCache } from "./NoteHandler"; import { DataStoreToCache, HolyNoteStore } from "./utils"; export const MessageType = findByCodeLazy("isEdited(){"); diff --git a/src/equicordplugins/holyNotes/utils.ts b/src/equicordplugins/holyNotes/utils.ts index 0ca66f309..76ce56186 100644 --- a/src/equicordplugins/holyNotes/utils.ts +++ b/src/equicordplugins/holyNotes/utils.ts @@ -8,7 +8,7 @@ import { createStore } from "@api/DataStore"; import { DataStore } from "@api/index"; import { Toasts } from "@webpack/common"; -import noteHandler, { noteHandlerCache } from "./NoteHandler"; +import { noteHandler, noteHandlerCache } from "./NoteHandler"; import { HolyNotes } from "./types"; export const HolyNoteStore = createStore("HolyNoteData", "HolyNoteStore"); diff --git a/src/equicordplugins/musicControls/tidal/TidalStore.ts b/src/equicordplugins/musicControls/tidal/TidalStore.ts index a5e1b1ec4..37503be81 100644 --- a/src/equicordplugins/musicControls/tidal/TidalStore.ts +++ b/src/equicordplugins/musicControls/tidal/TidalStore.ts @@ -149,7 +149,7 @@ export const TidalStore = proxyLazyWebpack(() => { public repeat: Repeat = 0; public shuffle = false; public volume = 100; - private playerElement: HTMLElement | null = null; + public playerElement: HTMLElement | null = null; public socket = new TidalSocket((message: Message) => { if (message.type === "update" && message.all && message.fields) { const apiData = message.fields; diff --git a/src/equicordplugins/musicControls/youtubeMusic/YtmStore.ts b/src/equicordplugins/musicControls/youtubeMusic/YtmStore.ts index e3e9e908b..75a8e2c48 100644 --- a/src/equicordplugins/musicControls/youtubeMusic/YtmStore.ts +++ b/src/equicordplugins/musicControls/youtubeMusic/YtmStore.ts @@ -110,7 +110,7 @@ type Message = PlayerInfo | VideoChanged | PlayerStateChanged | PositionChanged type PlayerState = Partial>; -class YoutubemusicSocket { +class YoutubeMusicSocket { public onChange: (e: PlayerState) => void; private ready = false; private connecting = false; @@ -185,7 +185,7 @@ export const YoutubeMusicStore = proxyLazyWebpack(() => { class YoutubeMusicStore extends Store { public mPosition = 0; - private start = 0; + public start = 0; public song: Song | null = null; public isPlaying = false; @@ -196,7 +196,7 @@ export const YoutubeMusicStore = proxyLazyWebpack(() => { public isSettingPosition = false; - public socket = new YoutubemusicSocket((message: PlayerState) => { + public socket = new YoutubeMusicSocket((message: PlayerState) => { if (message.song) { store.song = message.song; store.isPlaying = !(message.song?.isPaused ?? false); @@ -280,7 +280,7 @@ export const YoutubeMusicStore = proxyLazyWebpack(() => { this.req("post", "/api/v1/toggle-mute"); } - private req(method: "post" | "get" | "put", route: string, data: any = {}) { + public req(method: "post" | "get" | "put", route: string, data: any = {}) { const apiServerUrl = Settings.plugins.MusicControls.YoutubeMusicApiUrl; if (apiServerUrl === "") return; const url = apiServerUrl + route;