From 4243905e42d572d9539402f16c49f7d73b257c0b Mon Sep 17 00:00:00 2001 From: kmmiio99o <164557248+kmmiio99o@users.noreply.github.com> Date: Fri, 19 Sep 2025 21:30:24 +0200 Subject: [PATCH] factor V3 --- plugins/Last.fm/src/ui/pages/Settings.tsx | 43 +++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/plugins/Last.fm/src/ui/pages/Settings.tsx b/plugins/Last.fm/src/ui/pages/Settings.tsx index af7d916..4f7f07c 100644 --- a/plugins/Last.fm/src/ui/pages/Settings.tsx +++ b/plugins/Last.fm/src/ui/pages/Settings.tsx @@ -2,7 +2,7 @@ import { plugin } from "@vendetta"; import { getAssetIDByName } from "@vendetta/ui/assets"; import { showToast } from "@vendetta/ui/toasts"; import { React } from "@vendetta/metro/common"; -import { Linking } from "react-native"; +import { View, Linking } from "react-native"; import { changelog, currentVersion } from "../../changelog"; import { findByProps } from "@vendetta/metro"; @@ -14,6 +14,7 @@ const { TableRowGroup, TableSwitchRow, Stack, TableRow } = findByProps( "TableRow", ); const { TextInput } = findByProps("TextInput"); +const { FormText } = findByProps("FormText"); import { currentSettings, pluginState } from "../.."; import Constants from "../../constants"; @@ -23,7 +24,7 @@ import { lastfmClient } from "../../utils/lastfm"; const get = (k: string, fallback: any = "") => plugin.storage[k] ?? fallback; const set = (k: string, v: any) => (plugin.storage[k] = v); -export default function Settings() { +function Settings() { const [_, forceUpdate] = React.useReducer((x) => ~x, 0); const update = () => forceUpdate(); @@ -195,7 +196,45 @@ export default function Settings() { }} /> + + {/* Changelog Section */} + + {changelog.map((entry, index) => ( + + ))} + ); } + +export default { + settings: () => ( + + Loading Last.fm settings... + + } + > + + + ), + onLoad() { + pluginState.pluginStopped = false; + + if (!currentSettings.username || !currentSettings.apiKey) { + showToast( + "Please configure Last.fm username and API key in settings", + getAssetIDByName("ic_warning"), + ); + return; + } + }, +};