mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
added spotify auth callback
This commit is contained in:
parent
38e1eaa496
commit
fdd9e382cb
35
packages/app/src/pages/callbacks/sync/spotify/index.jsx
Normal file
35
packages/app/src/pages/callbacks/sync/spotify/index.jsx
Normal file
@ -0,0 +1,35 @@
|
||||
import React from "react"
|
||||
|
||||
import * as antd from "antd"
|
||||
|
||||
import SyncModel from "models/sync"
|
||||
|
||||
export default (props) => {
|
||||
const [error, setError] = React.useState(null)
|
||||
|
||||
const makeSync = async () => {
|
||||
const result = await SyncModel.spotifyCore.syncAuthCode(window.location.search.split("=")[1]).catch((err) => {
|
||||
setError(err.message)
|
||||
|
||||
return false
|
||||
})
|
||||
|
||||
if (result) {
|
||||
window.close()
|
||||
}
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
makeSync()
|
||||
}, [])
|
||||
|
||||
if (error) {
|
||||
return <antd.Result
|
||||
status="error"
|
||||
title="Error while syncing your Spotify account"
|
||||
subTitle={error}
|
||||
/>
|
||||
}
|
||||
|
||||
return <h3>Please wait meanwhile we are syncing your Spotify account</h3>
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user