Skip to content

Commit

Permalink
티스토리 지원 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
joostory committed Dec 24, 2023
1 parent a5db3a8 commit 25732fd
Show file tree
Hide file tree
Showing 8 changed files with 294 additions and 362 deletions.
623 changes: 275 additions & 348 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"babel-loader": "^9.0.0",
"cross-env": "^7.0.3",
"css-loader": "^6.2.0",
"css-minimizer-webpack-plugin": "^4.0.0",
"css-minimizer-webpack-plugin": "^5.0.1",
"debug": "^4.3.1",
"electron": "^23.1.1",
"electron-builder": "^23.0.3",
Expand All @@ -51,7 +51,7 @@
"npm-run-all": "^4.1.5",
"object-assign": "^4.1.1",
"react-test-renderer": "^18.1.0",
"regenerator-runtime": "^0.13.7",
"regenerator-runtime": "^0.14.1",
"resolve-url-loader": "^5.0.0",
"sass": "^1.32.5",
"sass-loader": "^13.0.0",
Expand Down Expand Up @@ -80,7 +80,7 @@
"highlight.js": "^11.0.1",
"immutability-helper": "^3.1.1",
"isomorphic-fetch": "^3.0.0",
"marked": "^4.0.10",
"marked": "^11.1.0",
"node-fetch": "^3.0.0",
"oauth": "^0.10.0",
"opengraph-fetcher": "^1.1.3",
Expand Down
2 changes: 1 addition & 1 deletion src/main/apis/tumblr-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ async function fetchAccount(auth) {
blogs = res.user.blogs
} catch (e) {
username = "불러오기 오류"
console.error(e)
console.error("FETCH_ACCOUNT_FAILED", e)
}

return {
Expand Down
11 changes: 8 additions & 3 deletions src/main/events/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ module.exports = () => {
ipcMain.on('fetch-initial-data', (evt) => {
console.log('Main.receive: fetch-initial-data')
let authList = AuthenticationManager.getAll()
evt.sender.send('initialized', [])
if (Array.isArray(authList) && authList.length > 0) {
fetchAccounts(authList).then(data => {
evt.sender.send('initialized', data)
})
fetchAccounts(authList)
.then(data => {
evt.sender.send('initialized', data)
})
.catch(e => {
evt.sender.send('initialized', [])
})
} else {
evt.sender.send('initialized', [])
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/lib/AuthenticationManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function load() {
if (settings.hasSync('authList')) {
authList = settings.getSync('authList')
}
authList = authList.filter(auth => auth != null)
authList = authList.filter(auth => auth != null).filter(auth => auth.provider != 'tistory')
console.log("load authList", authList)
}

Expand Down
3 changes: 0 additions & 3 deletions src/main/lib/ProviderApiManager.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
const tistory = require('../apis/tistory-api')
const tumblr = require('../apis/tumblr-api')


function getApi(provider) {
switch (provider) {
case 'tistory':
return tistory
case 'tumblr':
return tumblr
default:
Expand Down
7 changes: 6 additions & 1 deletion src/renderer/components/index/BlogList.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ const styles = {

function ServiceListHeader({service}) {
const provider = Providers.find(p => p.name == service.auth.provider)
if (!provider) {
return (
<></>
)
}

function handleDisconnect() {
if (confirm(`${provider.label} 서비스에 연결된 ${service.user.name} 계정을 제거하시겠습니까?`)) {
Expand Down Expand Up @@ -95,7 +100,7 @@ export default function BlogList({afterSelect}) {

return (
<>
{accounts.map(account =>
{accounts.filter(it => it.auth.provider != 'tistory').map(account =>
<List key={account.auth.uuid} subheader={<ServiceListHeader service={account} />}>
{[...account.blogs].sort((a,b) =>
a.primary? -1 : b.primary? 1 : 0
Expand Down
2 changes: 0 additions & 2 deletions src/renderer/constants/Providers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import tistoryLogo from '../images/logo_tistory.png'
import tumblrLogo from '../images/logo_tumblr.png'

class Provider {
Expand All @@ -10,6 +9,5 @@ class Provider {
}

export default [
new Provider('tistory', 'Tistory', tistoryLogo),
new Provider('tumblr', 'Tumblr', tumblrLogo)
]

0 comments on commit 25732fd

Please sign in to comment.