mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 17:35:16 +00:00
1 line
33 KiB
JSON
1 line
33 KiB
JSON
|
{"ast":null,"code":"var _jsxFileName = \"/app/src/Pages/User.js\",\n _s = $RefreshSig$();\n\nimport React, { useContext, useState, useEffect } from 'react';\nimport '../App.css';\nimport './User.css';\nimport { useHistory } from \"react-router\";\nimport AuthContext from '../Contexts/AuthContext';\nimport ScaleLoader from 'react-spinners/ScaleLoader';\nimport { Button } from 'reactstrap';\nimport { Formik, Form, Field } from 'formik';\nimport { confirmAlert } from 'react-confirm-alert';\nimport 'react-confirm-alert/src/react-confirm-alert.css';\nimport { getUser, patchUser, spotifyConnectionRequest, spotifyDisonnectionRequest, navidromeDisonnectionRequest, navidromeConnectionRequest } from '../Api/index';\nimport TimezoneSelect from 'react-timezone-select';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst User = () => {\n _s();\n\n const history = useHistory();\n const {\n user,\n Logout\n } = useContext(AuthContext);\n const [loading, setLoading] = useState(true);\n const [userdata, setUserdata] = useState({});\n\n const updateTimezone = vals => {\n setUserdata({ ...userdata,\n timezone: vals\n });\n patchUser({\n timezone: vals.value\n });\n };\n\n const resetTokenPopup = () => {\n confirmAlert({\n title: 'Reset token',\n message: 'Resetting your token will require you to update your Jellyfin server / custom scroblers with the new token. Continue?',\n buttons: [{\n label: 'Reset',\n onClick: () => resetToken()\n }, {\n label: 'No'\n }]\n });\n };\n\n const deleteAccountPopup = () => {\n confirmAlert({\n title: 'Delete Account',\n message: 'This will disable your account and queue it for deletion. Are you sure?',\n buttons: [{\n label: 'Yes',\n onClick: () => deleteAccount()\n }, {\n label: 'No'\n }]\n });\n };\n\n const connectNavidromePopup = () => {\n confirmAlert({\n title: 'Connect Navidrome',\n buttons: [{\n label: 'Close'\n }],\n childrenElement: () => /*#__PURE__*/_jsxDEV(Formik, {\n initialValues: {\n url: '',\n username: '',\n password: ''\n },\n onSubmit: values => navidromeConnectionRequest(values),\n children: /*#__PURE__*/_jsxDEV(Form, {\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Server URL\", /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 23\n }, this), /*#__PURE__*/_jsxDEV(Field, {\n name: \"url\",\n type: \"text\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Username\", /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 21\n }, this), /*#__PURE__*/_jsxDEV(Field, {\n name: \"username\",\n type: \"text\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 85,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"br\", {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 92,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password\", /*#__PURE__*/_jsxDEV(\"br\", {},
|