From 81630561793d283f31582588c08baf005a4a67cd Mon Sep 17 00:00:00 2001 From: SrGooglo Date: Thu, 15 May 2025 13:09:04 +0000 Subject: [PATCH] remove sync settings --- .../components/syncAccountButton/index.jsx | 94 ------------------- .../components/syncAccountButton/index.less | 52 ---------- packages/app/src/settings/sync/index.jsx | 66 ------------- 3 files changed, 212 deletions(-) delete mode 100755 packages/app/src/settings/sync/components/syncAccountButton/index.jsx delete mode 100755 packages/app/src/settings/sync/components/syncAccountButton/index.less delete mode 100755 packages/app/src/settings/sync/index.jsx diff --git a/packages/app/src/settings/sync/components/syncAccountButton/index.jsx b/packages/app/src/settings/sync/components/syncAccountButton/index.jsx deleted file mode 100755 index e0d8fd1a..00000000 --- a/packages/app/src/settings/sync/components/syncAccountButton/index.jsx +++ /dev/null @@ -1,94 +0,0 @@ -import React from "react" - -import { Button, Modal } from "antd" -import { Icons, createIconRender } from "@components/Icons" - -import SyncModel from "@models/sync" - -import "./index.less" - -export default (props) => { - const { namespace } = props - - const onUnlink = async () => { - Modal.confirm({ - title: "Are you sure you want to unlink?", - content: "The linked service will be unlinked from your account and you loose access to their features", - okText: "Logout", - okType: "danger", - cancelText: "Cancel", - onOk: async () => { - await SyncModel.unlinkService(namespace) - .then(() => { - app.message.success("Successfully unlinked account") - }) - .catch((err) => { - console.error(err) - app.message.error("Failed to unlink") - }) - } - }) - } - - const onLink = async () => { - const response = await SyncModel.linkService(namespace).catch((err) => { - console.error(err) - app.message.error(err.message) - - return null - }) - - if (!response) { - return null - } - - app.message.info("Successfully linked account") - } - - if (!namespace) { - return null - } - - if (!props.ctx.processedCtx.publicData) { - return null - } - - if (props.ctx.processedCtx.publicData[namespace]) { - return
-
- { - props.ctx.processedCtx.publicData[namespace].avatar - ? Account avatar - : - - createIconRender(props.icon) - } - -

- { - props.ctx.processedCtx.publicData[namespace].username - } -

-
- -
- -
-
- } - - return -} \ No newline at end of file diff --git a/packages/app/src/settings/sync/components/syncAccountButton/index.less b/packages/app/src/settings/sync/components/syncAccountButton/index.less deleted file mode 100755 index a9e09344..00000000 --- a/packages/app/src/settings/sync/components/syncAccountButton/index.less +++ /dev/null @@ -1,52 +0,0 @@ -.syncButton { - display: flex; - flex-direction: row; - - align-items: center; - justify-content: space-between; - - background-color: var(--background-color-primary); - - padding: 10px; - - border-radius: 12px; - - .syncButton_info { - display: flex; - flex-direction: row; - - align-items: center; - - img { - width: 40px; - height: 40px; - - object-fit: cover; - - border-radius: 12px; - - margin-right: 10px; - } - - p { - font-size: 0.8rem; - font-weight: 500; - line-height: 1.5; - margin: 0; - } - } - - .syncButton_actions { - display: flex; - - align-items: center; - - .ant-btn { - margin-left: 10px; - - &:first-child { - margin-left: 0; - } - } - } -} \ No newline at end of file diff --git a/packages/app/src/settings/sync/index.jsx b/packages/app/src/settings/sync/index.jsx deleted file mode 100755 index d57792d5..00000000 --- a/packages/app/src/settings/sync/index.jsx +++ /dev/null @@ -1,66 +0,0 @@ -import loadable from "@loadable/component" -import SyncModel from "@models/sync" - -// TODO: Make logout button require a valid session to be not disabled - -export default { - id: "sync", - icon: "MdSync", - label: "Sync", - group: "advanced", - //disabled: true, - ctxData: async () => { - const spotifyAccount = await SyncModel.spotifyCore.getData().catch((err) => { - return null - }) - - const tidalData = await SyncModel.tidalCore.getCurrentUser().catch((err) => { - return null - }) - - return { - publicData: { - spotify: spotifyAccount, - tidal: tidalData, - } - } - }, - settings: [ - { - id: "sync_settings", - icon: "MdSync", - title: "Sync Settings", - description: "Sync your settings across all devices stored in the cloud", - group: "sync.settings", - component: "Switch", - disabled: true, - storaged: false, - }, - { - id: "spotify", - icon: "SiSpotify", - title: "Spotify", - description: "Sync your Spotify account to get access to your playlists and other features", - group: "sync.accounts", - component: loadable(() => import("./components/syncAccountButton")), - props: { - icon: "SiSpotify", - namespace: "spotify" - }, - storaged: false - }, - { - id: "tidal", - icon: "SiTidal", - title: "Tidal", - description: "Sync your Tidal account to get access to your audio playback and playlists sync", - group: "sync.accounts", - component: loadable(() => import("./components/syncAccountButton")), - props: { - icon: "SiTidal", - namespace: "tidal" - }, - storaged: false - } - ] -} \ No newline at end of file